54 throw std::invalid_argument(
"NoisyCircuit: qbit_num must be >= 1");
69 other.total_params_ = 0;
79 other.total_params_ = 0;
241 std::unique_ptr<PhaseDampingOp>(
new PhaseDampingOp(target, lambda)));
251 throw std::runtime_error(
"NoisyCircuit::apply_to: qubit number mismatch");
255 throw std::runtime_error(
256 "NoisyCircuit::apply_to: not enough parameters. Expected " +
257 std::to_string(
total_params_) +
", got " + std::to_string(param_count));
264 int count = op->get_parameter_num();
266 const double *op_params = (count > 0) ? (params + start) :
nullptr;
267 op->apply_to_density(op_params, count, rho);
280 std::vector<NoisyCircuit::OperationInfo>
282 std::vector<OperationInfo> info;
Copyright (C) Miklos Maroti, 2021 SPDX-License-Identifier: Apache-2.0.
Header file for a class representing a CP gate.
void add_CZ(int target, int control)
void add_RZ(int target)
1 parameter
Header file for a class representing a controlled Z rotation gate.
void add_CRZ(int target, int control)
1 parameter
A class representing a controlled RX gate.
A class representing a CP gate.
void add_CNOT(int target, int control)
void add_local_depolarizing(int target)
Add parametric local single-qubit depolarizing noise (1 parameter)
~NoisyCircuit()
Destructor.
NoisyCircuit & operator=(const NoisyCircuit &)=delete
void add_U2(int target)
2 parameters
void add_phase_damping(int target)
Add parametric phase damping noise (1 parameter)
Header file for a class representing a controlled rotation gate around the Y axis.
void apply_to(const double *params, int param_count, DensityMatrix &rho)
Apply entire circuit to density matrix.
void add_U1(int target)
1 parameter
scalar * data
pointer to the stored data
Header file for a class representing a CH operation.
Header file for a class representing a controlled X rotation gate.
std::vector< OperationInfo > get_operation_info() const
Get information about all operations.
void add_CP(int target, int control)
1 parameter
void add_U3(int target)
3 parameters
A class representing a CZ operation.
Header file for a class representing a CNOT operation.
A class representing a CRY gate.
int rows
The number of rows.
A class representing a CH operation.
int cols
The number of columns.
NoisyCircuit(int qbit_num)
Create empty circuit for n qubits.
Amplitude damping channel (T1 relaxation): |1â© â |0â© decay.
std::vector< std::unique_ptr< IDensityOperation > > operations_
void add_depolarizing(int qbit_num)
Add parametric depolarizing noise channel (1 parameter)
void add_CRY(int target, int control)
1 parameter
Wraps an existing Gate for density matrix operations.
Quantum density matrix Ï for mixed-state representation.
Phase damping channel (T2 dephasing): loss of coherence.
Header file for a class representing a CZ operation.
A class representing a CNOT operation.
int get_qbit_num() const
Get number of qubits.
std::vector< int > param_starts_
Depolarizing noise channel: Ï â (1-p)Ï + p·I/2^n.
void add_RY(int target)
1 parameter
Information about a circuit operation.
void add_CH(int target, int control)
A class representing a controlled RZ gate.
Base class for the representation of general gate operations.
void add_RX(int target)
1 parameter
Local single-qubit depolarizing channel on one target qubit.
void add_operation(std::unique_ptr< IDensityOperation > op)
void add_CRX(int target, int control)
1 parameter
Quantum circuit with noise for density matrix simulation.
void add_amplitude_damping(int target)
Add parametric amplitude damping noise (1 parameter)
void add_gate_internal(Gate *gate)