QPanda3
0.1.0
Supported by OriginQ
|
Public Member Functions | |
None | __init__ (self) |
init(*args, **kwargs) Overloaded function. | |
None | __init__ (self, StateVector other) |
init(*args, **kwargs) Overloaded function. | |
None | __init__ (self, dict[int, complex] data) |
init(*args, **kwargs) Overloaded function. | |
None | __init__ (self, list[complex] data) |
init(*args, **kwargs) Overloaded function. | |
None | __init__ (self, numpy.ndarray[numpy.complex128[m, 1]] data) |
init(*args, **kwargs) Overloaded function. | |
None | __init__ (self, int qbit_total) |
init(*args, **kwargs) Overloaded function. | |
complex | at (self, int idx) |
at(self: quantum_info.StateVector, idx: int) -> complex | |
int | dim (self) |
dim(self: quantum_info.StateVector) -> int | |
StateVector | evolve (self, circuit) |
evolve(self: quantum_info.StateVector, circuit: QPanda::QCircuit) -> quantum_info.StateVector | |
Matrix | get_density_matrix (self) |
get_density_matrix(self: quantum_info.StateVector) -> quantum_info.Matrix | |
bool | is_valid (self) |
is_valid(self: quantum_info.StateVector) -> bool | |
numpy.ndarray[numpy.complex128] | ndarray (self) |
ndarray(self: quantum_info.StateVector) -> numpy.ndarray[numpy.complex128] | |
complex | purity (self) |
purity(self: quantum_info.StateVector) -> complex | |
StateVector | update_by_evolve (self, circuit) |
update_by_evolve(self: quantum_info.StateVector, circuit: QPanda::QCircuit) -> quantum_info.StateVector | |
bool | __eq__ (self, StateVector other) |
eq(self: quantum_info.StateVector, other: quantum_info.StateVector) -> bool | |
None pyqpanda3.quantum_info.StateVector.__init__ | ( | self | ) |
init(*args, **kwargs) Overloaded function.
Default constructor, which by default constructs a state vector for a quantum system with only one qubit and its current state being all zeros.
Generate a StateVector object from another StateVector object
other | another StateVector object |
Construct a state vector based on the input dictionary
data | a dictionary |
Construct a state vector based on a given complex number array
data | a complex number array |
Construct a state vector based on a given complex number array
data | a complex number array |
Specify the total number of qubits in the quantum system and generate a state vector where the state of each qubit is currently 0
qbit_total | the total number of qubits in the quantum system |
None pyqpanda3.quantum_info.StateVector.__init__ | ( | self, | |
StateVector | other ) |
init(*args, **kwargs) Overloaded function.
Default constructor, which by default constructs a state vector for a quantum system with only one qubit and its current state being all zeros.
Generate a StateVector object from another StateVector object
other | another StateVector object |
Construct a state vector based on the input dictionary
data | a dictionary |
Construct a state vector based on a given complex number array
data | a complex number array |
Construct a state vector based on a given complex number array
data | a complex number array |
Specify the total number of qubits in the quantum system and generate a state vector where the state of each qubit is currently 0
qbit_total | the total number of qubits in the quantum system |
None pyqpanda3.quantum_info.StateVector.__init__ | ( | self, | |
dict[int, complex] | data ) |
init(*args, **kwargs) Overloaded function.
Default constructor, which by default constructs a state vector for a quantum system with only one qubit and its current state being all zeros.
Generate a StateVector object from another StateVector object
other | another StateVector object |
Construct a state vector based on the input dictionary
data | a dictionary |
Construct a state vector based on a given complex number array
data | a complex number array |
Construct a state vector based on a given complex number array
data | a complex number array |
Specify the total number of qubits in the quantum system and generate a state vector where the state of each qubit is currently 0
qbit_total | the total number of qubits in the quantum system |
None pyqpanda3.quantum_info.StateVector.__init__ | ( | self, | |
list[complex] | data ) |
init(*args, **kwargs) Overloaded function.
Default constructor, which by default constructs a state vector for a quantum system with only one qubit and its current state being all zeros.
Generate a StateVector object from another StateVector object
other | another StateVector object |
Construct a state vector based on the input dictionary
data | a dictionary |
Construct a state vector based on a given complex number array
data | a complex number array |
Construct a state vector based on a given complex number array
data | a complex number array |
Specify the total number of qubits in the quantum system and generate a state vector where the state of each qubit is currently 0
qbit_total | the total number of qubits in the quantum system |
None pyqpanda3.quantum_info.StateVector.__init__ | ( | self, | |
numpy.ndarray[numpy.complex128[m, 1]] | data ) |
init(*args, **kwargs) Overloaded function.
Default constructor, which by default constructs a state vector for a quantum system with only one qubit and its current state being all zeros.
Generate a StateVector object from another StateVector object
other | another StateVector object |
Construct a state vector based on the input dictionary
data | a dictionary |
Construct a state vector based on a given complex number array
data | a complex number array |
Construct a state vector based on a given complex number array
data | a complex number array |
Specify the total number of qubits in the quantum system and generate a state vector where the state of each qubit is currently 0
qbit_total | the total number of qubits in the quantum system |
None pyqpanda3.quantum_info.StateVector.__init__ | ( | self, | |
int | qbit_total ) |
init(*args, **kwargs) Overloaded function.
Default constructor, which by default constructs a state vector for a quantum system with only one qubit and its current state being all zeros.
Generate a StateVector object from another StateVector object
other | another StateVector object |
Construct a state vector based on the input dictionary
data | a dictionary |
Construct a state vector based on a given complex number array
data | a complex number array |
Construct a state vector based on a given complex number array
data | a complex number array |
Specify the total number of qubits in the quantum system and generate a state vector where the state of each qubit is currently 0
qbit_total | the total number of qubits in the quantum system |
bool pyqpanda3.quantum_info.StateVector.__eq__ | ( | self, | |
StateVector | other ) |
eq(self: quantum_info.StateVector, other: quantum_info.StateVector) -> bool
Equality check. Determine if the internal data of two StateVector objects are equal.
StateVector | another StateVector object |
complex pyqpanda3.quantum_info.StateVector.at | ( | self, | |
int | idx ) |
at(self: quantum_info.StateVector, idx: int) -> complex
Retrieve the element with index
idx,the | index of the element |
int pyqpanda3.quantum_info.StateVector.dim | ( | self | ) |
dim(self: quantum_info.StateVector) -> int
Retrieve the number of ground states corresponding to the state vector
StateVector pyqpanda3.quantum_info.StateVector.evolve | ( | self, | |
circuit ) |
evolve(self: quantum_info.StateVector, circuit: QPanda::QCircuit) -> quantum_info.StateVector
Evolve the quantum state using the quantum circuit QCircuit without updating the internal data of the original StateVector object, and return the result as a new StateVector object
circuit | a quantum circuit QCircuit |
Matrix pyqpanda3.quantum_info.StateVector.get_density_matrix | ( | self | ) |
get_density_matrix(self: quantum_info.StateVector) -> quantum_info.Matrix
Retrieve the density matrix corresponding to the state vector.
bool pyqpanda3.quantum_info.StateVector.is_valid | ( | self | ) |
is_valid(self: quantum_info.StateVector) -> bool
Check if the internal data of the state vector is valid.
numpy.ndarray[numpy.complex128] pyqpanda3.quantum_info.StateVector.ndarray | ( | self | ) |
ndarray(self: quantum_info.StateVector) -> numpy.ndarray[numpy.complex128]
Generate a numpy.ndarray object using data in self
complex pyqpanda3.quantum_info.StateVector.purity | ( | self | ) |
purity(self: quantum_info.StateVector) -> complex
Retrieve the purity of the state vector.
StateVector pyqpanda3.quantum_info.StateVector.update_by_evolve | ( | self, | |
circuit ) |
update_by_evolve(self: quantum_info.StateVector, circuit: QPanda::QCircuit) -> quantum_info.StateVector
Evolve the quantum state using the quantum circuit QCircuit and update the internal data of the original StateVector object
circuit | a quantum circuit QCircuit |