• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 20149522919

11 Dec 2025 10:04PM UTC coverage: 88.29% (-0.01%) from 88.3%
20149522919

push

github

web-flow
Add ways to retrieve operations from the ``QkTarget`` (#15283)

* Initial: Add `QkTargetOperation` to the C-API
- Add struct ``QkTargetOperation`` which contains an operation type, a name, the number of qubits, and the parameters of the instruction.
    - The struct can only be returned via the usage of `qk_target_op_get` (name subject to change).
- If a user wanted to retreive the operation instance, in this case, a gate, we can use `qk_target_op_try_gate` to retrieve the instance, it is the user's responsibility to check whether this instance's type is `QkOperationKind_Gate`.

* Docs: Add documentation

* Test: Add tests

* Fix: initial review comments
- Rename `QkTargetOperation` to `QkTargetOp`.
- Document that users should not tamper with `CTargetOp` mutably.
- Remove `ExitCode` return from `qk_target_op_get`.
- Rename `target_op_try_gate` to `target_op_gate`.

* Docs: Add release note.

* Fix: Use actual number of parameters for `QkTargetOp`,

* Add: Support for returning variadics
- To support variadics, we added support to retrieve operations typed `QkOperationKind::PythonOp` and setting the number of qubits and parameters as `u32::MAX`.

* Fix: Review items

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* Chore: Rename `COperationKind::PythonOp` to `Unknwon`.

---------

Co-authored-by: Julien Gacon <gaconju@gmail.com>

65 of 98 new or added lines in 2 files covered. (66.33%)

10 existing lines in 4 files now uncovered.

96621 of 109436 relevant lines covered (88.29%)

1203824.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.09
/crates/qasm2/src/parse.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc