Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
List of all members | Public Member Functions | Private Member Functions | Private Attributes
squander::density::DepolarizingOp Class Reference

Depolarizing noise channel: ρ → (1-p)ρ + p·I/2^n. More...

#include <noise_operation.h>

Inheritance diagram for squander::density::DepolarizingOp:
Inheritance graph
[legend]

Public Member Functions

void apply_to_density (const double *params, int param_count, DensityMatrix &rho) override
 Apply this operation to the density matrix. More...
 
std::unique_ptr< IDensityOperationclone () const override
 Create a deep copy of this operation. More...
 
 DepolarizingOp (int qbit_num, double error_rate)
 Create depolarizing noise with fixed error rate. More...
 
 DepolarizingOp (int qbit_num)
 Create parametric depolarizing noise (1 parameter) More...
 
double get_error_rate () const
 
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_qbit_num () const
 
bool is_parametric () const
 
bool is_unitary () const override
 Check if this is a unitary operation (gate) or non-unitary (noise) More...
 

Private Member Functions

void apply_depolarizing (DensityMatrix &rho, double error_rate)
 

Private Attributes

double fixed_error_rate_
 
bool is_parametric_
 
int qbit_num_
 

Detailed Description

Depolarizing noise channel: ρ → (1-p)ρ + p·I/2^n.

Represents uniform noise that replaces the quantum state with the maximally mixed state with probability p. Physically models interaction with a thermal environment.

Properties:

Can be parametric (error rate from parameter array) or fixed.

Example:

// Fixed 1% error rate
auto noise = std::unique_ptr<DepolarizingOp>(new DepolarizingOp(2, 0.01));
// Parametric (error rate from optimizer)
auto noise = std::unique_ptr<DepolarizingOp>(new DepolarizingOp(2));

Definition at line 64 of file noise_operation.h.

Constructor & Destructor Documentation

◆ DepolarizingOp() [1/2]

squander::density::DepolarizingOp::DepolarizingOp ( int  qbit_num,
double  error_rate 
)

Create depolarizing noise with fixed error rate.

Parameters
qbit_numNumber of qubits the noise acts on
error_rateFixed depolarizing probability p ∈ [0, 1]

Definition at line 31 of file noise_operation.cpp.

Here is the caller graph for this function:

◆ DepolarizingOp() [2/2]

squander::density::DepolarizingOp::DepolarizingOp ( int  qbit_num)
explicit

Create parametric depolarizing noise (1 parameter)

Parameters
qbit_numNumber of qubits the noise acts on

Definition at line 41 of file noise_operation.cpp.

Member Function Documentation

◆ apply_depolarizing()

void squander::density::DepolarizingOp::apply_depolarizing ( DensityMatrix rho,
double  error_rate 
)
private

Definition at line 69 of file noise_operation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_to_density()

void squander::density::DepolarizingOp::apply_to_density ( const double *  params,
int  param_count,
DensityMatrix rho 
)
overridevirtual

Apply this operation to the density matrix.

Parameters
paramsPointer to this operation's parameters (may be nullptr if param_count=0)
param_countNumber of parameters for this operation
rhoThe density matrix to modify in-place

Implements squander::density::IDensityOperation.

Definition at line 48 of file noise_operation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone()

std::unique_ptr< IDensityOperation > squander::density::DepolarizingOp::clone ( ) const
overridevirtual

Create a deep copy of this operation.

Returns
Unique pointer to the cloned operation

Implements squander::density::IDensityOperation.

Definition at line 101 of file noise_operation.cpp.

Here is the call graph for this function:

◆ get_error_rate()

double squander::density::DepolarizingOp::get_error_rate ( ) const
inline

Definition at line 89 of file noise_operation.h.

◆ get_name()

std::string squander::density::DepolarizingOp::get_name ( ) const
inlineoverridevirtual

Get operation name for debugging/display.

Returns
Human-readable name (e.g., "H", "CNOT", "Depolarizing")

Implements squander::density::IDensityOperation.

Definition at line 83 of file noise_operation.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_parameter_num()

int squander::density::DepolarizingOp::get_parameter_num ( ) const
inlineoverridevirtual

Get number of free parameters this operation requires.

Returns
Number of parameters (0 for constant gates/fixed noise)

Implements squander::density::IDensityOperation.

Definition at line 82 of file noise_operation.h.

Here is the caller graph for this function:

◆ get_qbit_num()

int squander::density::DepolarizingOp::get_qbit_num ( ) const
inline

Definition at line 88 of file noise_operation.h.

◆ is_parametric()

bool squander::density::DepolarizingOp::is_parametric ( ) const
inline

Definition at line 90 of file noise_operation.h.

Here is the caller graph for this function:

◆ is_unitary()

bool squander::density::NoiseOperation::is_unitary ( ) const
inlineoverridevirtualinherited

Check if this is a unitary operation (gate) or non-unitary (noise)

Returns
true for unitary gates, false for noise channels

Implements squander::density::IDensityOperation.

Definition at line 38 of file noise_operation.h.

Here is the caller graph for this function:

Member Data Documentation

◆ fixed_error_rate_

double squander::density::DepolarizingOp::fixed_error_rate_
private

Definition at line 94 of file noise_operation.h.

◆ is_parametric_

bool squander::density::DepolarizingOp::is_parametric_
private

Definition at line 95 of file noise_operation.h.

◆ qbit_num_

int squander::density::DepolarizingOp::qbit_num_
private

Definition at line 93 of file noise_operation.h.


The documentation for this class was generated from the following files: