![]() |
QPanda3
Supported by OriginQ
|
Public 成员函数 | |
None | __init__ (self) |
init(self: core.core.CPUQVM) -> None | |
float | expval_hamiltonian (self, QProg prog, hamiltonian, int shots=..., NoiseModel noise_model=...) |
expval_hamiltonian(self: core.core.CPUQVM, prog: core.core.QProg, hamiltonian: QPanda3::Hamiltonian, shots: int = 1000, noise_model: core.core.NoiseModel = <core.core.NoiseModel object at 0x7f485423a7b0>) -> float | |
float | expval_pauli_operator (self, QProg prog, pauli_operator, int shots=..., NoiseModel noise_model=...) |
expval_pauli_operator(self: core.core.CPUQVM, prog: core.core.QProg, pauli_operator: QPanda3::PauliOperator, shots: int = 1000, noise_model: core.core.NoiseModel = <core.core.NoiseModel object at 0x7f484ebbcff0>) -> float | |
QResult | result (self) |
result(self: core.core.CPUQVM) -> core.core.QResult | |
None | run (self, QProg prog, int shots, NoiseModel model=...) |
run(self: core.core.CPUQVM, prog: core.core.QProg, shots: int, model: core.core.NoiseModel = <core.core.NoiseModel object at 0x7f484eb891b0>) -> None | |
None pyqpanda3.core.core.CPUQVM.__init__ | ( | self | ) |
init(self: core.core.CPUQVM) -> None
float pyqpanda3.core.core.CPUQVM.expval_hamiltonian | ( | self, | |
QProg | prog, | ||
hamiltonian, | |||
int | shots = ..., | ||
NoiseModel | noise_model = ... ) |
expval_hamiltonian(self: core.core.CPUQVM, prog: core.core.QProg, hamiltonian: QPanda3::Hamiltonian, shots: int = 1000, noise_model: core.core.NoiseModel = <core.core.NoiseModel object at 0x7f485423a7b0>) -> float
Calculate the expected value of a given Hamiltonian with respect to a quantum program.
This member function of the CPUQVM class computes the expected value (or expectation value) of a specified Hamiltonian using a quantum program. It allows for the simulation of quantum circuits with optional noise modeling.
prog | The quantum program to be executed. |
hamiltonian | The Hamiltonian for which the expected value is to be calculated. |
shots | The number of times the quantum program is sampled to estimate the expected value. Defaults to 1000 if not specified. |
noise_model | The noise model to be applied during the simulation. Defaults to a default-constructed NoiseModel if not specified. |
float pyqpanda3.core.core.CPUQVM.expval_pauli_operator | ( | self, | |
QProg | prog, | ||
pauli_operator, | |||
int | shots = ..., | ||
NoiseModel | noise_model = ... ) |
expval_pauli_operator(self: core.core.CPUQVM, prog: core.core.QProg, pauli_operator: QPanda3::PauliOperator, shots: int = 1000, noise_model: core.core.NoiseModel = <core.core.NoiseModel object at 0x7f484ebbcff0>) -> float
Calculate the expected value of a given PauliOperator with respect to a quantum program.
This member function of the CPUQVM class computes the expected value (or expectation value) of a specified PauliOperator using a quantum program. It allows for the simulation of quantum circuits with optional noise modeling.
prog | The quantum program to be executed. |
pauli_operator | The PauliOperator for which the expected value is to be calculated. |
shots | The number of times the quantum program is sampled to estimate the expected value. Defaults to 1000 if not specified. |
noise_model | The noise model to be applied during the simulation. Defaults to a default-constructed NoiseModel if not specified. |
QResult pyqpanda3.core.core.CPUQVM.result | ( | self | ) |
result(self: core.core.CPUQVM) -> core.core.QResult
Get the result of the quantum program execution.
None pyqpanda3.core.core.CPUQVM.run | ( | self, | |
QProg | prog, | ||
int | shots, | ||
NoiseModel | model = ... ) |
run(self: core.core.CPUQVM, prog: core.core.QProg, shots: int, model: core.core.NoiseModel = <core.core.NoiseModel object at 0x7f484eb891b0>) -> None
Run a quantum program using the CPUQVM simulator.
prog | The quantum program to be executed. |
shots | The number of shots (repetitions) for measurement. |
model | The noise model to apply (default is NoiseModel()). |