Quantum++  v1.1
A modern C++11 quantum computing library
qpp::States Class Referencefinal

const Singleton class that implements most commonly used states More...

#include <classes/states.h>

Inheritance diagram for qpp::States:
Collaboration diagram for qpp::States:

Public Member Functions

ket mes (idx d=2) const
 Maximally entangled state of 2 qudits. More...
 
ket zero (idx n, idx d=2) const
 Zero state of n qudits. More...
 
ket one (idx n, idx d=2) const
 One state of n qudits. More...
 
ket jn (idx j, idx n, idx d=2) const
 $|j\rangle^{\otimes n}$ state of n qudits More...
 
ket plus (idx n) const
 Plus state of n qubits. More...
 
ket minus (idx n) const
 Minus state of n qubits. More...
 

Public Attributes

ket x0 {ket::Zero(2)}
 Pauli Sigma-X 0-eigenstate |+> More...
 
ket x1 {ket::Zero(2)}
 Pauli Sigma-X 1-eigenstate |-> More...
 
ket y0 {ket::Zero(2)}
 Pauli Sigma-Y 0-eigenstate |y+> More...
 
ket y1 {ket::Zero(2)}
 Pauli Sigma-Y 1-eigenstate |y-> More...
 
ket z0 {ket::Zero(2)}
 Pauli Sigma-Z 0-eigenstate |0> More...
 
ket z1 {ket::Zero(2)}
 Pauli Sigma-Z 1-eigenstate |1> More...
 
cmat px0 {cmat::Zero(2, 2)}
 Projector onto the Pauli Sigma-X 0-eigenstate |+><+|. More...
 
cmat px1 {cmat::Zero(2, 2)}
 Projector onto the Pauli Sigma-X 1-eigenstate |-><-|. More...
 
cmat py0 {cmat::Zero(2, 2)}
 Projector onto the Pauli Sigma-Y 0-eigenstate |y+><y+|. More...
 
cmat py1 {cmat::Zero(2, 2)}
 Projector onto the Pauli Sigma-Y 1-eigenstate |y-><y-|. More...
 
cmat pz0 {cmat::Zero(2, 2)}
 Projector onto the Pauli Sigma-Z 0-eigenstate |0><0|. More...
 
cmat pz1 {cmat::Zero(2, 2)}
 Projector onto the Pauli Sigma-Z 1-eigenstate |1><1|. More...
 
ket b00 {ket::Zero(4)}
 Bell-00 state (following the convention in Nielsen and Chuang) More...
 
ket b01 {ket::Zero(4)}
 Bell-01 state (following the convention in Nielsen and Chuang) More...
 
ket b10 {ket::Zero(4)}
 Bell-10 state (following the convention in Nielsen and Chuang) More...
 
ket b11 {ket::Zero(4)}
 Bell-11 state (following the convention in Nielsen and Chuang) More...
 
cmat pb00 {cmat::Zero(4, 4)}
 Projector onto the Bell-00 state. More...
 
cmat pb01 {cmat::Zero(4, 4)}
 Projector onto the Bell-01 state. More...
 
cmat pb10 {cmat::Zero(4, 4)}
 Projector onto the Bell-10 state. More...
 
cmat pb11 {cmat::Zero(4, 4)}
 Projector onto the Bell-11 state. More...
 
ket GHZ {ket::Zero(8)}
 GHZ state. More...
 
ket W {ket::Zero(8)}
 W state. More...
 
cmat pGHZ {cmat::Zero(8, 8)}
 Projector onto the GHZ state. More...
 
cmat pW {cmat::Zero(8, 8)}
 Projector onto the W state. More...
 

Private Member Functions

 States ()
 
 ~States ()=default
 Default destructor. More...
 

Friends

class internal::Singleton< const States >
 

Additional Inherited Members

- Static Public Member Functions inherited from qpp::internal::Singleton< const States >
static const Statesget_instance () noexcept(std::is_nothrow_constructible< const States >::value)
 
static const Statesget_thread_local_instance () noexcept(std::is_nothrow_constructible< const States >::value)
 
- Protected Member Functions inherited from qpp::internal::Singleton< const States >
 Singleton () noexcept=default
 
 Singleton (const Singleton &)=delete
 
Singletonoperator= (const Singleton &)=delete
 
virtual ~Singleton ()=default
 

Detailed Description

const Singleton class that implements most commonly used states

Constructor & Destructor Documentation

◆ States()

qpp::States::States ( )
inlineprivate

Initialize the states

◆ ~States()

qpp::States::~States ( )
privatedefault

Default destructor.

Member Function Documentation

◆ jn()

ket qpp::States::jn ( idx  j,
idx  n,
idx  d = 2 
) const
inline

$|j\rangle^{\otimes n}$ state of n qudits

Parameters
jNon-negative integer
nNon-negative integer
dSubsystem dimensions
Returns
$|j\rangle^{\otimes n}$ state of n qudits

◆ mes()

ket qpp::States::mes ( idx  d = 2) const
inline

Maximally entangled state of 2 qudits.

Parameters
dSubsystem dimensions
Returns
Maximally entangled state $\frac{1}{\sqrt{d}}\sum_{j=0}^{d-1}|jj\rangle$ of 2 qudits

◆ minus()

ket qpp::States::minus ( idx  n) const
inline

Minus state of n qubits.

Parameters
nNon-negative integer
Returns
Minus state $|-\rangle^{\otimes n}$ of n qubits

◆ one()

ket qpp::States::one ( idx  n,
idx  d = 2 
) const
inline

One state of n qudits.

Parameters
nNon-negative integer
dSubsystem dimensions
Returns
One state $|1\rangle^{\otimes n}$ of n qudits

◆ plus()

ket qpp::States::plus ( idx  n) const
inline

Plus state of n qubits.

Parameters
nNon-negative integer
Returns
Plus state $|+\rangle^{\otimes n}$ of n qubits

◆ zero()

ket qpp::States::zero ( idx  n,
idx  d = 2 
) const
inline

Zero state of n qudits.

Parameters
nNon-negative integer
dSubsystem dimensions
Returns
Zero state $|0\rangle^{\otimes n}$ of n qudits

Friends And Related Function Documentation

◆ internal::Singleton< const States >

friend class internal::Singleton< const States >
friend

Member Data Documentation

◆ b00

ket qpp::States::b00 {ket::Zero(4)}

Bell-00 state (following the convention in Nielsen and Chuang)

◆ b01

ket qpp::States::b01 {ket::Zero(4)}

Bell-01 state (following the convention in Nielsen and Chuang)

◆ b10

ket qpp::States::b10 {ket::Zero(4)}

Bell-10 state (following the convention in Nielsen and Chuang)

◆ b11

ket qpp::States::b11 {ket::Zero(4)}

Bell-11 state (following the convention in Nielsen and Chuang)

◆ GHZ

ket qpp::States::GHZ {ket::Zero(8)}

GHZ state.

◆ pb00

cmat qpp::States::pb00 {cmat::Zero(4, 4)}

Projector onto the Bell-00 state.

◆ pb01

cmat qpp::States::pb01 {cmat::Zero(4, 4)}

Projector onto the Bell-01 state.

◆ pb10

cmat qpp::States::pb10 {cmat::Zero(4, 4)}

Projector onto the Bell-10 state.

◆ pb11

cmat qpp::States::pb11 {cmat::Zero(4, 4)}

Projector onto the Bell-11 state.

◆ pGHZ

cmat qpp::States::pGHZ {cmat::Zero(8, 8)}

Projector onto the GHZ state.

◆ pW

cmat qpp::States::pW {cmat::Zero(8, 8)}

Projector onto the W state.

◆ px0

cmat qpp::States::px0 {cmat::Zero(2, 2)}

Projector onto the Pauli Sigma-X 0-eigenstate |+><+|.

◆ px1

cmat qpp::States::px1 {cmat::Zero(2, 2)}

Projector onto the Pauli Sigma-X 1-eigenstate |-><-|.

◆ py0

cmat qpp::States::py0 {cmat::Zero(2, 2)}

Projector onto the Pauli Sigma-Y 0-eigenstate |y+><y+|.

◆ py1

cmat qpp::States::py1 {cmat::Zero(2, 2)}

Projector onto the Pauli Sigma-Y 1-eigenstate |y-><y-|.

◆ pz0

cmat qpp::States::pz0 {cmat::Zero(2, 2)}

Projector onto the Pauli Sigma-Z 0-eigenstate |0><0|.

◆ pz1

cmat qpp::States::pz1 {cmat::Zero(2, 2)}

Projector onto the Pauli Sigma-Z 1-eigenstate |1><1|.

◆ W

ket qpp::States::W {ket::Zero(8)}

W state.

◆ x0

ket qpp::States::x0 {ket::Zero(2)}

Pauli Sigma-X 0-eigenstate |+>

◆ x1

ket qpp::States::x1 {ket::Zero(2)}

Pauli Sigma-X 1-eigenstate |->

◆ y0

ket qpp::States::y0 {ket::Zero(2)}

Pauli Sigma-Y 0-eigenstate |y+>

◆ y1

ket qpp::States::y1 {ket::Zero(2)}

Pauli Sigma-Y 1-eigenstate |y->

◆ z0

ket qpp::States::z0 {ket::Zero(2)}

Pauli Sigma-Z 0-eigenstate |0>

◆ z1

ket qpp::States::z1 {ket::Zero(2)}

Pauli Sigma-Z 1-eigenstate |1>


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