|
Sequential Quantum Gate Decomposer
v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
|
Quantum circuit with noise for density matrix simulation. More...
#include <noisy_circuit.h>
Classes | |
| struct | OperationInfo |
| Information about a circuit operation. More... | |
Public Member Functions | |
| void | add_amplitude_damping (int target) |
| Add parametric amplitude damping noise (1 parameter) More... | |
| void | add_amplitude_damping (int target, double gamma) |
| Add fixed amplitude damping noise (T1 relaxation, 0 parameters) More... | |
| void | add_CH (int target, int control) |
| void | add_CNOT (int target, int control) |
| void | add_CP (int target, int control) |
| 1 parameter More... | |
| void | add_CRX (int target, int control) |
| 1 parameter More... | |
| void | add_CRY (int target, int control) |
| 1 parameter More... | |
| void | add_CRZ (int target, int control) |
| 1 parameter More... | |
| void | add_CZ (int target, int control) |
| void | add_depolarizing (int qbit_num) |
| Add parametric depolarizing noise channel (1 parameter) More... | |
| void | add_depolarizing (int qbit_num, double error_rate) |
| Add fixed depolarizing noise channel (0 parameters) More... | |
| void | add_H (int target) |
| void | add_local_depolarizing (int target) |
| Add parametric local single-qubit depolarizing noise (1 parameter) More... | |
| void | add_local_depolarizing (int target, double error_rate) |
| Add fixed local single-qubit depolarizing noise (0 parameters) More... | |
| void | add_phase_damping (int target) |
| Add parametric phase damping noise (1 parameter) More... | |
| void | add_phase_damping (int target, double lambda) |
| Add fixed phase damping noise (T2 dephasing, 0 parameters) More... | |
| void | add_RX (int target) |
| 1 parameter More... | |
| void | add_RY (int target) |
| 1 parameter More... | |
| void | add_RZ (int target) |
| 1 parameter More... | |
| void | add_S (int target) |
| void | add_Sdg (int target) |
| void | add_SX (int target) |
| void | add_T (int target) |
| void | add_Tdg (int target) |
| void | add_U1 (int target) |
| 1 parameter More... | |
| void | add_U2 (int target) |
| 2 parameters More... | |
| void | add_U3 (int target) |
| 3 parameters More... | |
| void | add_X (int target) |
| void | add_Y (int target) |
| void | add_Z (int target) |
| void | apply_to (const double *params, int param_count, DensityMatrix &rho) |
| Apply entire circuit to density matrix. More... | |
| void | apply_to (const matrix_base< double > ¶ms, DensityMatrix &rho) |
| Apply circuit using Matrix_real (backward compatibility) More... | |
| size_t | get_operation_count () const |
| Get number of operations in the circuit. More... | |
| std::vector< OperationInfo > | get_operation_info () const |
| Get information about all operations. More... | |
| int | get_parameter_num () const |
| Get total number of parameters needed. More... | |
| int | get_qbit_num () const |
| Get number of qubits. More... | |
| NoisyCircuit (int qbit_num) | |
| Create empty circuit for n qubits. More... | |
| NoisyCircuit (const NoisyCircuit &)=delete | |
| NoisyCircuit (NoisyCircuit &&other) noexcept | |
| NoisyCircuit & | operator= (const NoisyCircuit &)=delete |
| NoisyCircuit & | operator= (NoisyCircuit &&other) noexcept |
| ~NoisyCircuit () | |
| Destructor. More... | |
Private Member Functions | |
| void | add_gate_internal (Gate *gate) |
| void | add_operation (std::unique_ptr< IDensityOperation > op) |
Private Attributes | |
| std::vector< std::unique_ptr< IDensityOperation > > | operations_ |
| std::vector< int > | param_starts_ |
| int | qbit_num_ |
| int | total_params_ = 0 |
Quantum circuit with noise for density matrix simulation.
NoisyCircuit manages a sequence of unitary gates and noise channels, providing a unified interface to build and execute noisy quantum circuits.
Key features:
Example:
Definition at line 57 of file noisy_circuit.h.
|
explicit |
Create empty circuit for n qubits.
| qbit_num | Number of qubits (must be >= 1) |
Definition at line 52 of file noisy_circuit.cpp.

|
default |
Destructor.

|
delete |
|
noexcept |
Definition at line 64 of file noisy_circuit.cpp.
| void squander::density::NoisyCircuit::add_amplitude_damping | ( | int | target | ) |
Add parametric amplitude damping noise (1 parameter)
| target | Target qubit index |
Definition at line 225 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_amplitude_damping | ( | int | target, |
| double | gamma | ||
| ) |
Add fixed amplitude damping noise (T1 relaxation, 0 parameters)
| target | Target qubit index |
| gamma | Fixed damping γ â [0,1] |
Definition at line 230 of file noisy_circuit.cpp.

Definition at line 178 of file noisy_circuit.cpp.


Definition at line 170 of file noisy_circuit.cpp.


1 parameter
Definition at line 198 of file noisy_circuit.cpp.


1 parameter
Definition at line 194 of file noisy_circuit.cpp.


1 parameter
Definition at line 186 of file noisy_circuit.cpp.


1 parameter
Definition at line 190 of file noisy_circuit.cpp.


Definition at line 174 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_depolarizing | ( | int | qbit_num | ) |
Add parametric depolarizing noise channel (1 parameter)
| qbit_num | Number of qubits the noise acts on |
Definition at line 206 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_depolarizing | ( | int | qbit_num, |
| double | error_rate | ||
| ) |
Add fixed depolarizing noise channel (0 parameters)
| qbit_num | Number of qubits the noise acts on |
| error_rate | Fixed error rate p â [0,1] |
Definition at line 210 of file noisy_circuit.cpp.

|
private |
Definition at line 94 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_H | ( | int | target | ) |
Definition at line 102 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_local_depolarizing | ( | int | target | ) |
Add parametric local single-qubit depolarizing noise (1 parameter)
| target | Target qubit index |
Definition at line 215 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_local_depolarizing | ( | int | target, |
| double | error_rate | ||
| ) |
Add fixed local single-qubit depolarizing noise (0 parameters)
| target | Target qubit index |
| error_rate | Fixed depolarizing strength p in [0,1] |
Definition at line 220 of file noisy_circuit.cpp.

|
private |
| void squander::density::NoisyCircuit::add_phase_damping | ( | int | target | ) |
Add parametric phase damping noise (1 parameter)
| target | Target qubit index |
Definition at line 235 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_phase_damping | ( | int | target, |
| double | lambda | ||
| ) |
Add fixed phase damping noise (T2 dephasing, 0 parameters)
| target | Target qubit index |
| lambda | Fixed dephasing λ â [0,1] |
Definition at line 239 of file noisy_circuit.cpp.

| void squander::density::NoisyCircuit::add_RX | ( | int | target | ) |
1 parameter
Definition at line 142 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_RY | ( | int | target | ) |
1 parameter
Definition at line 146 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_RZ | ( | int | target | ) |
1 parameter
Definition at line 150 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_S | ( | int | target | ) |
Definition at line 118 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_Sdg | ( | int | target | ) |
Definition at line 122 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_SX | ( | int | target | ) |
Definition at line 134 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_T | ( | int | target | ) |
Definition at line 126 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_Tdg | ( | int | target | ) |
Definition at line 130 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_U1 | ( | int | target | ) |
1 parameter
Definition at line 154 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_U2 | ( | int | target | ) |
2 parameters
Definition at line 158 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_U3 | ( | int | target | ) |
3 parameters
Definition at line 162 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_X | ( | int | target | ) |
Definition at line 106 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_Y | ( | int | target | ) |
Definition at line 110 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::add_Z | ( | int | target | ) |
Definition at line 114 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::apply_to | ( | const double * | params, |
| int | param_count, | ||
| DensityMatrix & | rho | ||
| ) |
Apply entire circuit to density matrix.
| params | Parameter array (gate params followed by noise params) |
| param_count | Total number of parameters |
| rho | Density matrix to modify in-place |
Parameters are consumed in the order operations were added. Each parametric operation extracts its parameters from the array.
Definition at line 248 of file noisy_circuit.cpp.


| void squander::density::NoisyCircuit::apply_to | ( | const matrix_base< double > & | params, |
| DensityMatrix & | rho | ||
| ) |
Apply circuit using Matrix_real (backward compatibility)
Definition at line 271 of file noisy_circuit.cpp.

|
inline |
Get number of operations in the circuit.
Definition at line 217 of file noisy_circuit.h.

| std::vector< NoisyCircuit::OperationInfo > squander::density::NoisyCircuit::get_operation_info | ( | ) | const |
Get information about all operations.
Definition at line 281 of file noisy_circuit.cpp.

|
inline |
Get total number of parameters needed.
Definition at line 212 of file noisy_circuit.h.

|
inline |
Get number of qubits.
Definition at line 207 of file noisy_circuit.h.

|
delete |
|
noexcept |
Definition at line 72 of file noisy_circuit.cpp.
|
private |
Definition at line 240 of file noisy_circuit.h.
|
private |
Definition at line 241 of file noisy_circuit.h.
|
private |
Definition at line 239 of file noisy_circuit.h.
|
private |
Definition at line 242 of file noisy_circuit.h.
1.8.13