File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
crates/cext/src/transpiler Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -1343,8 +1343,9 @@ pub struct CTargetOp {
13431343 /// `(uint32_t)-1` in the case of a variadic.
13441344 pub num_qubits : u32 ,
13451345 /// The parameters tied to this operation if fixed, as an array
1346- /// of `double`. If the operation doesn't posess any fixed parameters
1347- /// or is variadic, this attribute will be a ``NULL`` pointer.
1346+ /// of `double`. If any of the parameters represented are not fixed angles
1347+ /// it will be represented as with the `NaN` value. If there are no parameters
1348+ /// then this value will be represented with a `NULL` pointer.
13481349 pub params : * mut f64 ,
13491350 /// The number of parameters supported by this operation. Will default to
13501351 /// `(uint32_t)-1` in the case of a variadic.
@@ -1426,9 +1427,9 @@ pub unsafe extern "C" fn qk_target_op_get(
14261427 operation
14271428 . params_view ( )
14281429 . iter ( )
1429- . filter_map ( |param| match param {
1430- Param :: Float ( number) => Some ( * number) ,
1431- _ => None ,
1430+ . map ( |param| match param {
1431+ Param :: Float ( number) => * number,
1432+ _ => f64 :: NAN ,
14321433 } )
14331434 . collect ( ) ,
14341435 ) ;
Original file line number Diff line number Diff line change 1+ ---
2+ fixes :
3+ - |
4+ Fixed a mismatch in :c:struct:`QkTargetOp` in which the length of the array
5+ stored in :c:member:`QkTargetOp.params` did not match the number exposed by
6+ :c:member:`QkTargetOp.num_params`. Wildcard parameters are now represented
7+ by ``NAN``, and the length of the array will always be :c:member:`QkTargetOp.num_params`.
8+ This bug was only present in 2.3.0rc1.
You can’t perform that action at this time.
0 commit comments