QPanda3
0.1.0
Supported by OriginQ
|
Public Member Functions | |
None | __init__ (self) |
init(self: vqcircuit.VQCResult) -> None | |
at (self, *args, **kwargs) | |
at(self: vqcircuit.VQCResult, idxs: list[int]) -> QPanda::QCircuit | |
float | expval_at (self, list[int] idxs) |
expval_at(self: vqcircuit.VQCResult, idxs: list[int]) -> float | |
list[float] | expval_hamiltonian (self, hamiltonian, ExpectationType exp_type=...) |
expval_hamiltonian(*args, **kwargs) Overloaded function. | |
float | expval_hamiltonian (self, hamiltonian, list[int] idx_s, ExpectationType exp_type=...) |
expval_hamiltonian(*args, **kwargs) Overloaded function. | |
list[float] | expval_pauli_operator (self, pauli_operator, ExpectationType exp_type=...) |
expval_pauli_operator(*args, **kwargs) Overloaded function. | |
float | expval_pauli_operator (self, pauli_operator, list[int] idx_s, ExpectationType exp_type=...) |
expval_pauli_operator(*args, **kwargs) Overloaded function. | |
None pyqpanda3.vqcircuit.VQCResult.__init__ | ( | self | ) |
init(self: vqcircuit.VQCResult) -> None
Default constructor for the VQCircuitResult class.
This constructor initializes a new instance of the VQCircuitResult class. The VQCircuitResult class is used to store and manage a collection of QCircuit objects generated by a VQCircuit.
pyqpanda3.vqcircuit.VQCResult.at | ( | self, | |
* | args, | ||
** | kwargs ) |
at(self: vqcircuit.VQCResult, idxs: list[int]) -> QPanda::QCircuit
Accesses a QCircuit object at a specified index.
This method retrieves a reference to the QCircuit object at the specified index, which is determined by the provided vector of qubit indices. The vector should contain the indices of the qubits that correspond to the desired QCircuit.
idxs | the specified index |
float pyqpanda3.vqcircuit.VQCResult.expval_at | ( | self, | |
list[int] | idxs ) |
expval_at(self: vqcircuit.VQCResult, idxs: list[int]) -> float
Calculates the expectation value of a QCircuit object at a specified index.
idxs | the specified index |
list[float] pyqpanda3.vqcircuit.VQCResult.expval_hamiltonian | ( | self, | |
hamiltonian, | |||
ExpectationType | exp_type = ... ) |
expval_hamiltonian(*args, **kwargs) Overloaded function.
Computes the expectation values of a Hamiltonian for all QCircuit objects in the batch.
This function calculates the expectation value of a given Hamiltonian for each QCircuit in the batch represented by the VQCircuitResult. The expectation value can be computed using either theoretical or sampled methods, depending on the specified \\type\\\\
parameter.
hamiltonian | the a Hamiltonian object |
exp_type | Not it only support ExpectationType.THEORETICAL |
Computes the expectation value of a Hamiltonian for a specific QCircuit object identified by multi-dimensional indexs.
This function calculates the expectation value of a given Hamiltonian for a specific QCircuit object in a collection, identified by the multi-dimensional index \\idx_s\\\\
. The expectation value can be computed using either a theoretical or sampled method,depending on the specified \\type\\\\
parameter.
hamiltonian | the a Hamiltonian object |
idx_s | multi-dimensional indexs. |
exp_type | Not it only support ExpectationType.THEORETICAL |
float pyqpanda3.vqcircuit.VQCResult.expval_hamiltonian | ( | self, | |
hamiltonian, | |||
list[int] | idx_s, | ||
ExpectationType | exp_type = ... ) |
expval_hamiltonian(*args, **kwargs) Overloaded function.
Computes the expectation values of a Hamiltonian for all QCircuit objects in the batch.
This function calculates the expectation value of a given Hamiltonian for each QCircuit in the batch represented by the VQCircuitResult. The expectation value can be computed using either theoretical or sampled methods, depending on the specified \\type\\\\
parameter.
hamiltonian | the a Hamiltonian object |
exp_type | Not it only support ExpectationType.THEORETICAL |
Computes the expectation value of a Hamiltonian for a specific QCircuit object identified by multi-dimensional indexs.
This function calculates the expectation value of a given Hamiltonian for a specific QCircuit object in a collection, identified by the multi-dimensional index \\idx_s\\\\
. The expectation value can be computed using either a theoretical or sampled method,depending on the specified \\type\\\\
parameter.
hamiltonian | the a Hamiltonian object |
idx_s | multi-dimensional indexs. |
exp_type | Not it only support ExpectationType.THEORETICAL |
list[float] pyqpanda3.vqcircuit.VQCResult.expval_pauli_operator | ( | self, | |
pauli_operator, | |||
ExpectationType | exp_type = ... ) |
expval_pauli_operator(*args, **kwargs) Overloaded function.
Computes the expectation value of a Pauli operator for all QCircuit objects in the batch.
This function calculates the expectation value of a given Pauli operator for each QCircuit in the batch represented by the VQCircuitResult. The expectation value can be computed using either theoretical or sampled methods, depending on the specified \\type\\\\
parameter.
pauli_operator | the a Pauli operator object |
exp_type | Not it only support ExpectationType.THEORETICAL |
Computes the expectation value of a Pauli operator for a specific QCircuit object identified by multi-dimensional indexs.
This function calculates the expectation value of a given Pauli operator for a specific QCircuit object in a collection, identified by the multi-dimensional index \\idx_s\\\\
. The expectation value can be computed using either a theoretical or sampled method,depending on the specified \\type\\\\
parameter.
pauli_operator | the a Pauli operator object |
idx_s | multi-dimensional indexs. |
exp_type | Not it only support ExpectationType.THEORETICAL |
float pyqpanda3.vqcircuit.VQCResult.expval_pauli_operator | ( | self, | |
pauli_operator, | |||
list[int] | idx_s, | ||
ExpectationType | exp_type = ... ) |
expval_pauli_operator(*args, **kwargs) Overloaded function.
Computes the expectation value of a Pauli operator for all QCircuit objects in the batch.
This function calculates the expectation value of a given Pauli operator for each QCircuit in the batch represented by the VQCircuitResult. The expectation value can be computed using either theoretical or sampled methods, depending on the specified \\type\\\\
parameter.
pauli_operator | the a Pauli operator object |
exp_type | Not it only support ExpectationType.THEORETICAL |
Computes the expectation value of a Pauli operator for a specific QCircuit object identified by multi-dimensional indexs.
This function calculates the expectation value of a given Pauli operator for a specific QCircuit object in a collection, identified by the multi-dimensional index \\idx_s\\\\
. The expectation value can be computed using either a theoretical or sampled method,depending on the specified \\type\\\\
parameter.
pauli_operator | the a Pauli operator object |
idx_s | multi-dimensional indexs. |
exp_type | Not it only support ExpectationType.THEORETICAL |