QPanda3
Supported by OriginQ
载入中...
搜索中...
未找到
pyqpanda3.core.core.CPUQVM类 参考

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
 

构造及析构函数说明

◆ __init__()

None pyqpanda3.core.core.CPUQVM.__init__ ( self)

init(self: core.core.CPUQVM) -> None

成员函数说明

◆ expval_hamiltonian()

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.

参数
progThe quantum program to be executed.
hamiltonianThe Hamiltonian for which the expected value is to be calculated.
shotsThe number of times the quantum program is sampled to estimate the expected value. Defaults to 1000 if not specified.
noise_modelThe noise model to be applied during the simulation. Defaults to a default-constructed NoiseModel if not specified.
返回
The expected value of the Hamiltonian as a double.

◆ expval_pauli_operator()

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.

参数
progThe quantum program to be executed.
pauli_operatorThe PauliOperator for which the expected value is to be calculated.
shotsThe number of times the quantum program is sampled to estimate the expected value. Defaults to 1000 if not specified.
noise_modelThe noise model to be applied during the simulation. Defaults to a default-constructed NoiseModel if not specified.
返回
The expected value of the PauliOperator as a double.

◆ result()

QResult pyqpanda3.core.core.CPUQVM.result ( self)

result(self: core.core.CPUQVM) -> core.core.QResult

Get the result of the quantum program execution.

返回
The result of the quantum simulation.

◆ run()

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.

参数
progThe quantum program to be executed.
shotsThe number of shots (repetitions) for measurement.
modelThe noise model to apply (default is NoiseModel()).
返回
None

该类的文档由以下文件生成: