|
Quandary
|
Base class for quantum gate operations. More...
#include <gate.hpp>

Public Member Functions | |
| Gate () | |
| Gate (const std::vector< size_t > &nlevels_, const std::vector< size_t > &nessential_, double time_, const std::vector< double > &gate_rot_freq, DecoherenceType decoherence_type_, bool quietmode=false) | |
| Constructor for quantum gates. | |
| virtual | ~Gate () |
| PetscInt | getDimRho () |
| Retrieves the dimension of the density matrix. | |
| void | assembleGate () |
| Assembles the vectorized gate matrix. | |
| void | applyGate (const Vec state, Vec VrhoV) |
| Applies the gate transformation to a quantum state. | |
Protected Attributes | |
| Mat | V_re |
| Mat | V_im |
| Real and imaginary parts of V_target, non-vectorized, essential levels only. | |
| std::vector< size_t > | nessential |
| Number of essential levels per oscillator. | |
| std::vector< size_t > | nlevels |
| Total number of levels per oscillator. | |
| int | mpirank_petsc |
| MPI rank in PETSc communicator. | |
| int | mpisize_petsc |
| MPI size in PETSc communicator. | |
| int | mpirank_world |
| MPI rank in world communicator. | |
| bool | quietmode |
| Flag to suppress output messages. | |
| PetscInt | dim_ess |
| Dimension of target gate matrix (non-vectorized), essential levels only. | |
| PetscInt | dim_rho |
| Dimension of system matrix rho (non-vectorized), all levels, N. | |
| double | final_time |
| Final time T. Time of gate rotation. | |
| std::vector< double > | gate_rot_freq |
| Frequencies of gate rotation (rad/time). Default: 0.0. | |
| DecoherenceType | decoherence_type |
| Type of Lindblad operators for open system dynamics. | |
Base class for quantum gate operations.
The Gate class provides the fundamental interface for quantum gate operations in quantum optimal control. It handles the transformation \(V \rho V^\dagger\) where \(V\) is the unitary gate matrix (target unitary transformation).
| Gate::Gate | ( | ) |
| Gate::Gate | ( | const std::vector< size_t > & | nlevels_, |
| const std::vector< size_t > & | nessential_, | ||
| double | time_, | ||
| const std::vector< double > & | gate_rot_freq, | ||
| DecoherenceType | decoherence_type_, | ||
| bool | quietmode = false |
||
| ) |
Constructor for quantum gates.
| nlevels_ | Number of levels per oscillator. |
| nessential_ | Number of essential levels per oscillator. |
| time_ | Final time for gate rotation. |
| gate_rot_freq | Frequencies of gate rotation (rad/time). |
| decoherence_type_ | Type of Lindblad operators for open system dynamics. |
| quietmode | Flag to suppress output messages (default: false). |
|
virtual |
| void Gate::applyGate | ( | const Vec | state, |
| Vec | VrhoV | ||
| ) |
Applies the gate transformation to a quantum state.
Computes \(V\rho V^\dagger\) where \(V\) is the gate matrix and \(\rho\) is the input state. The output vector VrhoV must be pre-allocated.
| state | Input quantum state vector. |
| VrhoV | Output vector storing the transformed state. |
| void Gate::assembleGate | ( | ) |
Assembles the vectorized gate matrix.
Computes VxV_re = \(\text{Re}(\bar{V} \otimes V)\) and VxV_im = \(\text{Im}(\bar{V} \otimes V)\) where V is the gate matrix.
|
inline |
Retrieves the dimension of the density matrix.
|
protected |
Type of Lindblad operators for open system dynamics.
|
protected |
Dimension of target gate matrix (non-vectorized), essential levels only.
|
protected |
Dimension of system matrix rho (non-vectorized), all levels, N.
|
protected |
Final time T. Time of gate rotation.
|
protected |
Frequencies of gate rotation (rad/time). Default: 0.0.
|
protected |
MPI rank in PETSc communicator.
|
protected |
MPI rank in world communicator.
|
protected |
MPI size in PETSc communicator.
|
protected |
Number of essential levels per oscillator.
|
protected |
Total number of levels per oscillator.
|
protected |
Flag to suppress output messages.
|
protected |
Real and imaginary parts of V_target, non-vectorized, essential levels only.
|
protected |