|
Sequential Quantum Gate Decomposer
v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Wraps an existing Gate for density matrix operations. More...
#include <gate_operation.h>

Public Member Functions | |
| void | apply_to_density (const double *params, int param_count, DensityMatrix &rho) override |
| Apply gate to density matrix using optimized local kernel. More... | |
| std::unique_ptr< IDensityOperation > | clone () const override |
| Create a deep copy of this operation. More... | |
| GateOperation (Gate *gate, bool owns_gate=true) | |
| Wrap an existing gate. More... | |
| GateOperation (const GateOperation &)=delete | |
| GateOperation (GateOperation &&other) noexcept | |
| int | get_control_qbit () const |
| Get control qubit index (-1 if not a controlled gate) More... | |
| Gate * | get_gate () const |
| Get the underlying gate (for inspection) More... | |
| std::string | get_name () const override |
| Get operation name for debugging/display. More... | |
| int | get_parameter_num () const override |
| Get number of free parameters this operation requires. More... | |
| int | get_target_qbit () const |
| Get target qubit index. More... | |
| bool | is_unitary () const override |
| Check if this is a unitary operation (gate) or non-unitary (noise) More... | |
| GateOperation & | operator= (const GateOperation &)=delete |
| GateOperation & | operator= (GateOperation &&other) noexcept |
| ~GateOperation () override | |
| Destructor - deletes gate if owns_gate was true. More... | |
Private Attributes | |
| Gate * | gate_ |
| bool | owns_gate_ |
Wraps an existing Gate for density matrix operations.
This adapter allows existing SQUANDER gates (H, CNOT, RZ, etc.) to be used in noisy circuits operating on density matrices.
Uses optimized local kernel application:
Does NOT modify the original Gate class - clean separation of concerns.
Example:
Definition at line 45 of file gate_operation.h.
Wrap an existing gate.
| gate | The gate to wrap |
| owns_gate | If true, this wrapper will delete the gate on destruction |
Definition at line 32 of file gate_operation.cpp.

|
override |
Destructor - deletes gate if owns_gate was true.
Definition at line 39 of file gate_operation.cpp.
|
delete |
|
noexcept |
Definition at line 50 of file gate_operation.cpp.
|
overridevirtual |
Apply gate to density matrix using optimized local kernel.
For single-qubit gates, applies the 2x2 kernel directly. For two-qubit gates, applies the 4x4 kernel directly. This is O(2^{2N+k}) instead of O(2^{3N}) for k-qubit gates.
Implements squander::density::IDensityOperation.
Definition at line 73 of file gate_operation.cpp.


|
overridevirtual |
Create a deep copy of this operation.
Implements squander::density::IDensityOperation.
Definition at line 175 of file gate_operation.cpp.


| int squander::density::GateOperation::get_control_qbit | ( | ) | const |
Get control qubit index (-1 if not a controlled gate)
Definition at line 167 of file gate_operation.cpp.


|
inline |
Get the underlying gate (for inspection)
Definition at line 86 of file gate_operation.h.

|
overridevirtual |
Get operation name for debugging/display.
Implements squander::density::IDensityOperation.
Definition at line 159 of file gate_operation.cpp.


|
overridevirtual |
Get number of free parameters this operation requires.
Implements squander::density::IDensityOperation.
Definition at line 155 of file gate_operation.cpp.


| int squander::density::GateOperation::get_target_qbit | ( | ) | const |
Get target qubit index.
Definition at line 163 of file gate_operation.cpp.


|
inlineoverridevirtual |
Check if this is a unitary operation (gate) or non-unitary (noise)
Implements squander::density::IDensityOperation.
Definition at line 79 of file gate_operation.h.


|
delete |
|
noexcept |
Definition at line 56 of file gate_operation.cpp.
|
private |
Definition at line 99 of file gate_operation.h.
|
private |
Definition at line 100 of file gate_operation.h.
1.8.13