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