Qrack  9.0
General classical-emulating-quantum development framework
Public Member Functions | Protected Attributes | List of all members
Qrack::QCircuit Class Reference

#include <qcircuit.hpp>

Public Member Functions

 QCircuit (bool collapse=true, bool clifford=false)
 Default constructor. More...
 
 QCircuit (bitLenInt qbCount, const std::list< QCircuitGatePtr > &g, bool collapse=true, bool clifford=false)
 Manual constructor. More...
 
QCircuitPtr Clone ()
 
QCircuitPtr Inverse ()
 
bitLenInt GetQubitCount ()
 Get the (automatically calculated) count of qubits in this circuit, so far. More...
 
void SetQubitCount (bitLenInt n)
 Set the count of qubits in this circuit, so far. More...
 
std::list< QCircuitGatePtrGetGateList ()
 Return the raw list of gates. More...
 
void SetGateList (std::list< QCircuitGatePtr > gl)
 Set the raw list of gates. More...
 
void Swap (bitLenInt q1, bitLenInt q2)
 Add a Swap gate to the gate sequence. More...
 
void Append (QCircuitPtr circuit)
 Append circuit (with identical qubit index mappings) at the end of this circuit. More...
 
void Combine (QCircuitPtr circuit)
 Combine circuit (with identical qubit index mappings) at the end of this circuit, by acting all additional gates in sequence. More...
 
void AppendGate (QCircuitGatePtr nGate)
 Add a gate to the gate sequence. More...
 
void Run (QInterfacePtr qsim)
 Run this circuit. More...
 
bool IsNonPhaseTarget (bitLenInt qubit)
 Check if an index is any target qubit of this circuit. More...
 
void DeletePhaseTarget (bitLenInt qubit, bool eigen)
 (If the qubit is not a target of a non-phase gate...) Delete this qubits' controls and phase targets. More...
 
QCircuitPtr PastLightCone (std::set< bitLenInt > &qubits)
 Return (as a new QCircuit) just the gates on the past light cone of a set of qubit indices. More...
 
void INC (bitCapInt toAdd, bitLenInt start, bitLenInt length)
 Add integer (without sign) More...
 

Protected Attributes

bool isCollapsed
 
bool isNearClifford
 
bitLenInt qubitCount
 
std::list< QCircuitGatePtrgates
 

Constructor & Destructor Documentation

◆ QCircuit() [1/2]

Qrack::QCircuit::QCircuit ( bool  collapse = true,
bool  clifford = false 
)
inline

Default constructor.

◆ QCircuit() [2/2]

Qrack::QCircuit::QCircuit ( bitLenInt  qbCount,
const std::list< QCircuitGatePtr > &  g,
bool  collapse = true,
bool  clifford = false 
)
inline

Manual constructor.

Member Function Documentation

◆ Append()

void Qrack::QCircuit::Append ( QCircuitPtr  circuit)
inline

Append circuit (with identical qubit index mappings) at the end of this circuit.

◆ AppendGate()

void Qrack::QCircuit::AppendGate ( QCircuitGatePtr  nGate)

Add a gate to the gate sequence.

◆ Clone()

QCircuitPtr Qrack::QCircuit::Clone ( )
inline

◆ Combine()

void Qrack::QCircuit::Combine ( QCircuitPtr  circuit)
inline

Combine circuit (with identical qubit index mappings) at the end of this circuit, by acting all additional gates in sequence.

◆ DeletePhaseTarget()

void Qrack::QCircuit::DeletePhaseTarget ( bitLenInt  qubit,
bool  eigen 
)
inline

(If the qubit is not a target of a non-phase gate...) Delete this qubits' controls and phase targets.

◆ GetGateList()

std::list<QCircuitGatePtr> Qrack::QCircuit::GetGateList ( )
inline

Return the raw list of gates.

◆ GetQubitCount()

bitLenInt Qrack::QCircuit::GetQubitCount ( )
inline

Get the (automatically calculated) count of qubits in this circuit, so far.

◆ INC()

void Qrack::QCircuit::INC ( bitCapInt  toAdd,
bitLenInt  start,
bitLenInt  length 
)

Add integer (without sign)

◆ Inverse()

QCircuitPtr Qrack::QCircuit::Inverse ( )
inline

◆ IsNonPhaseTarget()

bool Qrack::QCircuit::IsNonPhaseTarget ( bitLenInt  qubit)
inline

Check if an index is any target qubit of this circuit.

◆ PastLightCone()

QCircuitPtr Qrack::QCircuit::PastLightCone ( std::set< bitLenInt > &  qubits)
inline

Return (as a new QCircuit) just the gates on the past light cone of a set of qubit indices.

◆ Run()

void Qrack::QCircuit::Run ( QInterfacePtr  qsim)

Run this circuit.

◆ SetGateList()

void Qrack::QCircuit::SetGateList ( std::list< QCircuitGatePtr gl)
inline

Set the raw list of gates.

◆ SetQubitCount()

void Qrack::QCircuit::SetQubitCount ( bitLenInt  n)
inline

Set the count of qubits in this circuit, so far.

◆ Swap()

void Qrack::QCircuit::Swap ( bitLenInt  q1,
bitLenInt  q2 
)
inline

Add a Swap gate to the gate sequence.

Member Data Documentation

◆ gates

std::list<QCircuitGatePtr> Qrack::QCircuit::gates
protected

◆ isCollapsed

bool Qrack::QCircuit::isCollapsed
protected

◆ isNearClifford

bool Qrack::QCircuit::isNearClifford
protected

◆ qubitCount

bitLenInt Qrack::QCircuit::qubitCount
protected

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