85 void applyGate(
const Vec state, Vec VrhoV);
99 XGate(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
114 YGate(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
129 ZGate(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
144 HadamardGate(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
161 CNOT(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
178 SWAP(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
191 SWAP_0Q(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
203 CQNOT(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
214 QFT(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
bool quietmode=
false);
236 FromFile(
const std::vector<size_t>& nlevels_,
const std::vector<size_t>& nessential_,
double time,
const std::vector<double>& rotation_frequencies_,
DecoherenceType decoherence_type_,
const std::string& filename,
bool quietmode=
false);
257Gate*
initTargetGate(
GateType target_gate,
const std::string& file,
const std::vector<size_t>& nlevels,
const std::vector<size_t>& nessential,
double total_time,
DecoherenceType decoherence_type,
const std::vector<double>& gate_rot_freq,
bool quietmode);
Controlled-NOT (CNOT) gate implementation.
Definition gate.hpp:159
~CNOT()
Definition gate.cpp:388
Multi-qubit CQNOT gate implementation.
Definition gate.hpp:201
~CQNOT()
Definition gate.cpp:478
Gate loaded from external file.
Definition gate.hpp:223
~FromFile()
Definition gate.cpp:544
Base class for quantum gate operations.
Definition gate.hpp:18
bool quietmode
Flag to suppress output messages.
Definition gate.hpp:28
DecoherenceType decoherence_type
Type of Lindblad operators for open system dynamics.
Definition gate.hpp:36
double final_time
Final time T. Time of gate rotation.
Definition gate.hpp:33
std::vector< double > gate_rot_freq
Frequencies of gate rotation (rad/time). Default: 0.0.
Definition gate.hpp:34
PetscInt dim_rho
Dimension of system matrix rho (non-vectorized), all levels, N.
Definition gate.hpp:31
Gate()
Definition gate.cpp:4
Mat V_re
Definition gate.hpp:20
void applyGate(const Vec state, Vec VrhoV)
Applies the gate transformation to a quantum state.
Definition gate.cpp:261
PetscInt dim_ess
Dimension of target gate matrix (non-vectorized), essential levels only.
Definition gate.hpp:30
PetscInt getDimRho()
Retrieves the dimension of the density matrix.
Definition gate.hpp:66
std::vector< size_t > nlevels
Total number of levels per oscillator.
Definition gate.hpp:23
std::vector< size_t > nessential
Number of essential levels per oscillator.
Definition gate.hpp:22
Mat V_im
Real and imaginary parts of V_target, non-vectorized, essential levels only.
Definition gate.hpp:20
virtual ~Gate()
Definition gate.cpp:78
int mpirank_petsc
MPI rank in PETSc communicator.
Definition gate.hpp:24
int mpirank_world
MPI rank in world communicator.
Definition gate.hpp:26
void assembleGate()
Assembles the vectorized gate matrix.
Definition gate.cpp:89
int mpisize_petsc
MPI size in PETSc communicator.
Definition gate.hpp:25
Hadamard gate implementation.
Definition gate.hpp:142
~HadamardGate()
Definition gate.cpp:362
Quantum Fourier Transform gate implementation.
Definition gate.hpp:212
~QFT()
Definition gate.cpp:503
Multi-qubit SWAP gate implementation.
Definition gate.hpp:189
~SWAP_0Q()
Definition gate.cpp:449
SWAP gate implementation.
Definition gate.hpp:176
~SWAP()
Definition gate.cpp:410
Pauli-X gate implementation.
Definition gate.hpp:97
~XGate()
Definition gate.cpp:304
Pauli-Y gate implementation.
Definition gate.hpp:112
~YGate()
Definition gate.cpp:322
Pauli-Z gate implementation.
Definition gate.hpp:127
~ZGate()
Definition gate.cpp:341
Core type definitions and enumerations for Quandary quantum optimal control.
DecoherenceType
Available Lindblad operator types for open quantum systems, or NONE for closed quantum systems.
Definition defs.hpp:31
GateType
Types of quantum gates used in quantum control.
Definition defs.hpp:200
Gate * initTargetGate(GateType target_gate, const std::string &file, const std::vector< size_t > &nlevels, const std::vector< size_t > &nessential, double total_time, DecoherenceType decoherence_type, const std::vector< double > &gate_rot_freq, bool quietmode)
Factory function to initialize a gate from configuration string.
Definition gate.cpp:547