CunqaCircuit instructions
This page is a curated, categorized overview of the instructions offered by
CunqaCircuit. It is meant as an entry point; the complete and
authoritative list of methods (with full signatures) is generated from the source in the
cunqa.circuit API reference.
Unless stated otherwise, the param/theta argument of parametric gates accepts a number or a
parameter string (a placeholder whose value is supplied at execution time; see
Parameters and upgrade_parameters). Methods taking *qubits receive the involved qubit
indices in order (controls first, target last).
Construction and registers
Method / property |
Description |
|---|---|
|
Create a circuit. |
|
Returns the |
|
Reserve additional communication qubits. |
|
Add a named quantum / classical register. |
|
Properties exposing the circuit identifier, sizes and the serialized circuit. |
Single-qubit gates (no parameters)
i, x, y, z, h, s, sdg, sx, sxdg, t, tdg, v, vdg
and other fixed single-qubit gates. All take a single qubit index, e.g.:
circuit.h(0)
circuit.x(1)
Single-qubit gates (parametric)
Method |
Description |
|---|---|
|
Rotations about the X / Y / Z axis: |
|
Phase gate: |
|
Two-parameter single-qubit gates: |
|
General single-qubit gate: |
|
Rotation about an arbitrary axis: |
Two-qubit gates
Method |
Description |
|---|---|
|
Controlled Pauli / Hadamard: |
|
Two-qubit non-controlled gates: |
|
Controlled rotations / phase: |
|
Two-qubit interaction rotations: |
|
Other parametric two-qubit gates. |
Multi-qubit and controlled gates
Method |
Description |
|---|---|
|
Three-qubit gates (Toffoli, Fredkin, …). |
|
Multi-controlled versions; controls first, target last. |
|
Multi-controlled parametric gates. |
|
Multi-controlled gates with explicit control count / axis / control states. |
Pauli strings and gadgets
Method |
Description |
|---|---|
|
Apply a Pauli string (e.g. |
|
Pauli exponential (“gadget”) rotations. |
|
Phase gadget instructions. |
|
Multi-qubit Pauli operators and rotations. |
Matrix and special instructions
Method |
Description |
|---|---|
|
Apply an arbitrary (controlled) unitary matrix. |
|
Apply a sparse or diagonal matrix. |
|
Apply a random unitary (optional |
|
Block-wise fused swap. |
Noise instructions
Circuit-level noise channels (only meaningful on noise-capable simulators, see
Simulators): amplitudedampingnoise, bitflipnoise, dephasingnoise,
depolarizingnoise, independentxznoise, twoqubitdepolarizingnoise. Each takes a
probability and the target qubit(s), e.g. circuit.depolarizingnoise(0.01, 0).
Measurement and state
Method |
Description |
|---|---|
|
|
Measure all data qubits into a new |
|
Reset qubit(s) to \(|0\rangle\) (use after a measurement). |
|
Save the simulation state (statevector / density matrix) into the result. |
Classical control
Method |
Description |
|---|---|
Open a classically conditioned block: |
|
Close a |
Distributed directives
These instructions only work on vQPUs deployed with the corresponding communications enabled.
Method |
Description |
|---|---|
Classical-communications primitives: send / receive a measured classical bit to / from a remote circuit. |
|
Low-level entanglement-generation primitive underlying the quantum communications protocols. |
For the high-level teledata and telegate protocols built on top of gen_ent, use
the cunqa.qc_protocols helpers (qsend,
qrecv, cat_entangler,
cat_disentangler).