QPanda3  0.1.0
Supported by OriginQ
Loading...
Searching...
No Matches
pyqpanda3.vqcircuit.VQCResult Class Reference

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.
 

Constructor & Destructor Documentation

◆ __init__()

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.

Member Function Documentation

◆ at()

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.

Parameters
idxsthe specified index
Returns
a reference to the QCircuit object at the specified index

◆ expval_at()

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.

Parameters
idxsthe specified index
Returns
the expectation value of a QCircuit object at a specified index.

◆ expval_hamiltonian() [1/2]

list[float] pyqpanda3.vqcircuit.VQCResult.expval_hamiltonian ( self,
hamiltonian,
ExpectationType exp_type = ... )

expval_hamiltonian(*args, **kwargs) Overloaded function.

  1. expval_hamiltonian(self: vqcircuit.VQCResult, hamiltonian: QPanda::Hamiltonian, exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> list[float]

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.

Parameters
hamiltonianthe a Hamiltonian object
exp_typeNot it only support ExpectationType.THEORETICAL
Returns
the expectation values of a Hamiltonian for all QCircuit objects in the batch.
  1. expval_hamiltonian(self: vqcircuit.VQCResult, hamiltonian: QPanda::Hamiltonian, idx_s: list[int], exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> float

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.

Parameters
hamiltonianthe a Hamiltonian object
idx_smulti-dimensional indexs.
exp_typeNot it only support ExpectationType.THEORETICAL

◆ expval_hamiltonian() [2/2]

float pyqpanda3.vqcircuit.VQCResult.expval_hamiltonian ( self,
hamiltonian,
list[int] idx_s,
ExpectationType exp_type = ... )

expval_hamiltonian(*args, **kwargs) Overloaded function.

  1. expval_hamiltonian(self: vqcircuit.VQCResult, hamiltonian: QPanda::Hamiltonian, exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> list[float]

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.

Parameters
hamiltonianthe a Hamiltonian object
exp_typeNot it only support ExpectationType.THEORETICAL
Returns
the expectation values of a Hamiltonian for all QCircuit objects in the batch.
  1. expval_hamiltonian(self: vqcircuit.VQCResult, hamiltonian: QPanda::Hamiltonian, idx_s: list[int], exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> float

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.

Parameters
hamiltonianthe a Hamiltonian object
idx_smulti-dimensional indexs.
exp_typeNot it only support ExpectationType.THEORETICAL

◆ expval_pauli_operator() [1/2]

list[float] pyqpanda3.vqcircuit.VQCResult.expval_pauli_operator ( self,
pauli_operator,
ExpectationType exp_type = ... )

expval_pauli_operator(*args, **kwargs) Overloaded function.

  1. expval_pauli_operator(self: vqcircuit.VQCResult, pauli_operator: QPanda::PauliOperator, exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> list[float]

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.

Parameters
pauli_operatorthe a Pauli operator object
exp_typeNot it only support ExpectationType.THEORETICAL
Returns
the expectation values of a Pauli operator for all QCircuit objects in the batch.
  1. expval_pauli_operator(self: vqcircuit.VQCResult, pauli_operator: QPanda::PauliOperator, idx_s: list[int], exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> float

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.

Parameters
pauli_operatorthe a Pauli operator object
idx_smulti-dimensional indexs.
exp_typeNot it only support ExpectationType.THEORETICAL

◆ expval_pauli_operator() [2/2]

float pyqpanda3.vqcircuit.VQCResult.expval_pauli_operator ( self,
pauli_operator,
list[int] idx_s,
ExpectationType exp_type = ... )

expval_pauli_operator(*args, **kwargs) Overloaded function.

  1. expval_pauli_operator(self: vqcircuit.VQCResult, pauli_operator: QPanda::PauliOperator, exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> list[float]

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.

Parameters
pauli_operatorthe a Pauli operator object
exp_typeNot it only support ExpectationType.THEORETICAL
Returns
the expectation values of a Pauli operator for all QCircuit objects in the batch.
  1. expval_pauli_operator(self: vqcircuit.VQCResult, pauli_operator: QPanda::PauliOperator, idx_s: list[int], exp_type: vqcircuit.ExpectationType = <ExpectationType.THEORETICAL: 0>) -> float

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.

Parameters
pauli_operatorthe a Pauli operator object
idx_smulti-dimensional indexs.
exp_typeNot it only support ExpectationType.THEORETICAL

The documentation for this class was generated from the following file: