class QPanda::QProg

Overview

Quantum program,can construct quantum circuit,data struct is linked list. More...

Inherited Members

Detailed Documentation

Quantum program,can construct quantum circuit,data struct is linked list.

Methods

Insert a new Node at the end of current quantum circuit.

Parameters:

QNode* quantum node

Returns:

void

See also:

QNode

Insert new Node at the end of current node.

if T_GATE is QSingleGateNode/QDoubleGateNode/QIfEndNode, deep copy T_GATE and insert it into left QProg; if T_GATE is QIfProg/QWhileProg/QProg,deepcopy IF/WHILE/QProg circuit and insert it into left QProg

Parameters:

Node QGate/QCircuit/QProg/QIf/QWhile

Returns:

QPanda::QProg & quantum program

See also:

QNode

Get the first NodeIter.

Returns:

NodeIter

Get the last NodeIter.

Returns:

NodeIter

Get the end NodeIter.

Returns:

NodeIter

Get the head NodeIter.

Returns:

NodeIter

Insert a new QNode at the location specified by NodeIter.

Parameters:

NodeIter& specified location
std::shared_ptr<QNode> Inserted QNode

Returns:

NodeIter

Delete a QNode at the location specified by NodeIter.

Parameters:

NodeIter& specified location

Returns:

NodeIter Deleted NodeIter

Clear all node in current quantum program node.

Gets the maximum physical address of used qubits.

Returns:

size_t maximum physical address

Get the used qubits for current quantum program.

Parameters:

QVec used qubits vector

Returns:

size_t

Get the used classical bits for current quantum program.

Parameters:

QVec used qubits vector

Returns:

size_t

Get current quantum program qgate number.

Returns:

size_t

Measure operation in the last position of the program.

Returns:

bool

Get Measure operation position of the program.

Returns:

std::map<Qubit*, bool>

Get Measure operation qubits and cbits vector.

Returns:

std::vector<std::pair<Qubit*, ClassicalCondition>>