Quantum++  v1.2
A modern C++11 quantum computing library
qpp::NoiseBase< T > Class Template Reference

Base class for all noise models, derive your particular noise model. More...

#include <classes/noise.h>

Collaboration diagram for qpp::NoiseBase< T >:

Public Types

using noise_type = T
 

Public Member Functions

template<typename U = noise_type>
 NoiseBase (const std::vector< cmat > &Ks, typename std::enable_if< std::is_same< NoiseType::StateDependent, U >::value >::type *=nullptr)
 Constructs a noise instance for StateDependent noise type. More...
 
template<typename U = noise_type>
 NoiseBase (const std::vector< cmat > &Ks, const std::vector< double > &probs, typename std::enable_if< std::is_same< NoiseType::StateIndependent, U >::value >::type *=nullptr)
 Constructs a noise instance for StateIndependent noise type. More...
 
virtual ~NoiseBase ()=default
 Default virtual destructor. More...
 
idx get_d () const noexcept
 Qudit dimension. More...
 
std::vector< cmatget_Ks () const
 Vector of noise operators. More...
 
std::vector< double > get_probs () const
 Vector of probabilities corresponding to each noise operator. More...
 
idx get_last_idx () const
 Index of the last occurring noise element. More...
 
double get_last_p () const
 Probability of the last occurring noise element. More...
 
cmat get_last_K () const
 Last occurring noise element. More...
 
virtual cmat operator() (const cmat &state) const
 Function invocation operator, applies the underlying noise model on the state vector or density matrix state. More...
 
virtual cmat operator() (const cmat &state, idx target) const
 Function invocation operator, applies the underlying noise model on qudit target of the multi-partite state vector or density matrix state. More...
 
virtual cmat operator() (const cmat &state, const std::vector< idx > &target) const
 Function invocation operator, applies the underlying correlated noise model on qudits specified by target of the multi-partite state vector or density matrix state. More...
 

Protected Member Functions

void compute_probs_ (const cmat &state, const std::vector< idx > &target) const
 Compute probability outcomes for StateDependent noise type, otherwise returns without performing any operation (no-op) More...
 
cmat compute_state_ (const cmat &state, const std::vector< idx > &target) const
 Compute the resulting state after the noise was applied. More...
 

Protected Attributes

const std::vector< cmatKs_
 Kraus operators. More...
 
std::vector< double > probs_
 probabilities More...
 
idx d_ {}
 qudit dimension More...
 
idx i_ {}
 index of the last occurring noise element More...
 
bool generated_ {false}
 invoked, or if the noise is state-independent More...
 

Detailed Description

template<class T>
class qpp::NoiseBase< T >

Base class for all noise models, derive your particular noise model.

Member Typedef Documentation

◆ noise_type

template<class T>
using qpp::NoiseBase< T >::noise_type = T

Constructor & Destructor Documentation

◆ NoiseBase() [1/2]

template<class T>
template<typename U = noise_type>
qpp::NoiseBase< T >::NoiseBase ( const std::vector< cmat > &  Ks,
typename std::enable_if< std::is_same< NoiseType::StateDependent, U >::value >::type *  = nullptr 
)
inlineexplicit

Constructs a noise instance for StateDependent noise type.

Note
SFINAEd-out for StateIndependent noise
Parameters
AEigen expression (state vector or density matrix)
KsVector of noise (Kraus) operators that specify the noise
dSubsystem dimension

◆ NoiseBase() [2/2]

template<class T>
template<typename U = noise_type>
qpp::NoiseBase< T >::NoiseBase ( const std::vector< cmat > &  Ks,
const std::vector< double > &  probs,
typename std::enable_if< std::is_same< NoiseType::StateIndependent, U >::value >::type *  = nullptr 
)
inlineexplicit

Constructs a noise instance for StateIndependent noise type.

Note
SFINAEd-out for StateDependent noise
Parameters
AEigen expression (state vector or density matrix)
KsVector of noise (Kraus) operators that specify the noise
dSubsystem dimension

◆ ~NoiseBase()

template<class T>
virtual qpp::NoiseBase< T >::~NoiseBase ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ compute_probs_()

template<class T>
void qpp::NoiseBase< T >::compute_probs_ ( const cmat state,
const std::vector< idx > &  target 
) const
inlineprotected

Compute probability outcomes for StateDependent noise type, otherwise returns without performing any operation (no-op)

Parameters
stateState vector or density matrix
targetQudit indexes where the noise is applied

◆ compute_state_()

template<class T>
cmat qpp::NoiseBase< T >::compute_state_ ( const cmat state,
const std::vector< idx > &  target 
) const
inlineprotected

Compute the resulting state after the noise was applied.

Parameters
stateState vector or density matrix
targetQudit indexes where the noise is applied
Returns
Resulting state after the noise was applied

◆ get_d()

template<class T>
idx qpp::NoiseBase< T >::get_d ( ) const
inlinenoexcept

Qudit dimension.

Returns
Qudit dimension

◆ get_Ks()

template<class T>
std::vector<cmat> qpp::NoiseBase< T >::get_Ks ( ) const
inline

Vector of noise operators.

Returns
Vector of noise operators

◆ get_last_idx()

template<class T>
idx qpp::NoiseBase< T >::get_last_idx ( ) const
inline

Index of the last occurring noise element.

Returns
Index of the last occurring noise element

◆ get_last_K()

template<class T>
cmat qpp::NoiseBase< T >::get_last_K ( ) const
inline

Last occurring noise element.

Returns
Last occurring noise element

◆ get_last_p()

template<class T>
double qpp::NoiseBase< T >::get_last_p ( ) const
inline

Probability of the last occurring noise element.

Returns
Probability of the last occurring noise element

◆ get_probs()

template<class T>
std::vector<double> qpp::NoiseBase< T >::get_probs ( ) const
inline

Vector of probabilities corresponding to each noise operator.

Returns
Probability vector

◆ operator()() [1/3]

template<class T>
virtual cmat qpp::NoiseBase< T >::operator() ( const cmat state) const
inlinevirtual

Function invocation operator, applies the underlying noise model on the state vector or density matrix state.

Parameters
stateState vector or density matrix
Returns
Resulting state vector or density matrix

◆ operator()() [2/3]

template<class T>
virtual cmat qpp::NoiseBase< T >::operator() ( const cmat state,
idx  target 
) const
inlinevirtual

Function invocation operator, applies the underlying noise model on qudit target of the multi-partite state vector or density matrix state.

Parameters
stateMulti-partite state vector or density matrix
targetQudit index where the noise is applied
Returns
Resulting state vector or density matrix

◆ operator()() [3/3]

template<class T>
virtual cmat qpp::NoiseBase< T >::operator() ( const cmat state,
const std::vector< idx > &  target 
) const
inlinevirtual

Function invocation operator, applies the underlying correlated noise model on qudits specified by target of the multi-partite state vector or density matrix state.

Parameters
stateMulti-partite state vector or density matrix
targetQudit indexes where the correlated noise is applied
Returns
Resulting state vector or density matrix

Member Data Documentation

◆ d_

template<class T>
idx qpp::NoiseBase< T >::d_ {}
mutableprotected

qudit dimension

◆ generated_

template<class T>
bool qpp::NoiseBase< T >::generated_ {false}
mutableprotected

invoked, or if the noise is state-independent

set to true after compute_state_() is

◆ i_

template<class T>
idx qpp::NoiseBase< T >::i_ {}
mutableprotected

index of the last occurring noise element

◆ Ks_

template<class T>
const std::vector<cmat> qpp::NoiseBase< T >::Ks_
protected

Kraus operators.

◆ probs_

template<class T>
std::vector<double> qpp::NoiseBase< T >::probs_
mutableprotected

probabilities


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