XACC
Public Member Functions | Protected Attributes | List of all members
xacc::quantum::PauliOperator Class Reference
Inheritance diagram for xacc::quantum::PauliOperator:
xacc::Observable xacc::Cloneable< Observable > xacc::Identifiable

Public Member Functions

std::shared_ptr< Observableclone () override
 
std::unordered_map< std::string, Term >::iterator begin ()
 
std::unordered_map< std::string, Term >::iterator end ()
 
 PauliOperator (std::complex< double > c)
 
 PauliOperator (double c)
 
 PauliOperator (std::string fromString)
 
 PauliOperator (std::complex< double > c, std::string var)
 
 PauliOperator (const PauliOperator &i)
 
 PauliOperator (std::map< int, std::string > operators)
 
 PauliOperator (std::map< int, std::string > operators, std::string var)
 
 PauliOperator (std::map< int, std::string > operators, std::complex< double > coeff)
 
 PauliOperator (std::map< int, std::string > operators, double coeff)
 
 PauliOperator (std::map< int, std::string > operators, std::complex< double > coeff, std::string var)
 
std::vector< std::shared_ptr< CompositeInstruction > > observe (std::shared_ptr< CompositeInstruction > function) override
 
std::vector< std::shared_ptr< Observable > > getSubTerms () override
 
std::vector< std::shared_ptr< Observable > > getNonIdentitySubTerms () override
 
std::shared_ptr< ObservablegetIdentitySubTerm () override
 
std::complex< double > coefficient () override
 
const std::vector< std::pair< std::string, std::complex< double > > > computeActionOnKet (const std::string &bitString)
 
const std::vector< std::pair< std::string, std::complex< double > > > computeActionOnBra (const std::string &bitString)
 
const int nTerms ()
 
std::pair< std::vector< int >, std::vector< int > > toBinaryVectors (const int nQubits)
 
const std::string toString () override
 
void fromString (const std::string str) override
 
bool contains (PauliOperator &op)
 
bool commutes (PauliOperator &op)
 
void mapQubitSites (std::map< int, int > &siteMap)
 
void clear ()
 
std::unordered_map< std::string, TermgetTerms () const
 
std::vector< SparseTripletgetSparseMatrixElements ()
 
std::vector< std::complex< double > > toDenseMatrix (const int nQubits)
 
std::vector< SparseTripletto_sparse_matrix () override
 
std::shared_ptr< IRtoXACCIR ()
 
void fromXACCIR (std::shared_ptr< IR > ir)
 
PauliOperator eval (const std::map< std::string, std::complex< double >> varToValMap)
 
bool isClose (PauliOperator &other)
 
int nQubits ()
 
const int nBits () override
 
PauliOperatoroperator+= (const PauliOperator &v) noexcept
 
PauliOperatoroperator-= (const PauliOperator &v) noexcept
 
PauliOperatoroperator*= (const PauliOperator &v) noexcept
 
bool operator== (const PauliOperator &v) noexcept
 
PauliOperatoroperator*= (const double v) noexcept
 
PauliOperatoroperator*= (const std::complex< double > v) noexcept
 
const std::string name () const override
 
const std::string description () const override
 
void fromOptions (const HeterogeneousMap &options) override
 
std::shared_ptr< Observablecommutator (std::shared_ptr< Observable > obs) override
 
- Public Member Functions inherited from xacc::Observable
virtual void fromOptions (const HeterogeneousMap &&options)
 
- Public Member Functions inherited from xacc::Identifiable
virtual ~Identifiable ()
 
- Public Member Functions inherited from xacc::Cloneable< Observable >
virtual bool shouldClone ()
 
virtual ~Cloneable ()
 

Protected Attributes

std::unordered_map< std::string, Termterms
 

Constructor & Destructor Documentation

xacc::quantum::PauliOperator::PauliOperator ( std::map< int, std::string >  operators)

The Constructor, takes a vector of qubit-gatename pairs. Initializes coefficient to 1

Parameters
operatorsThe pauli operators making up this SpinInstruction
xacc::quantum::PauliOperator::PauliOperator ( std::map< int, std::string >  operators,
std::complex< double >  coeff 
)

The Constructor, takes a vector of qubit-gatename pairs and this instruction's coefficient

Parameters
operators
coeff

Member Function Documentation

const std::string xacc::quantum::PauliOperator::description ( ) const
inlineoverridevirtual

Return the description of this instance

Returns
description The description of this object.

Implements xacc::Identifiable.

const std::string xacc::quantum::PauliOperator::name ( ) const
inlineoverridevirtual

Return the name of this instance.

Returns
name The string name

Implements xacc::Identifiable.

const std::string xacc::quantum::PauliOperator::toString ( )
overridevirtual

Persist this Instruction to an assembly-like string.

Parameters
bufferVarNameThe name of the AcceleratorBuffer
Returns
str The assembly-like string.

Implements xacc::Observable.


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