QPanda3  0.1.0
Supported by OriginQ
Loading...
Searching...
No Matches
pyqpanda3.core.QResult Class Reference
Inheritance diagram for pyqpanda3.core.QResult:

Public Member Functions

None __init__ (self)
 init(self: core.QResult) -> None
 
None add_result (self, int cbit_addr, bool result)
 add_result(self: core.QResult, cbit_addr: int, result: bool) -> None
 
dict[str, int] get_counts (self)
 get_counts(self: core.QResult) -> dict[str, int]
 
dict[str, float] get_measure_probs (self)
 get_measure_probs(self: core.QResult) -> dict[str, float]
 
dict[str, float] get_prob_dict (self, list[int] qubits=...)
 get_prob_dict(self: core.QResult, qubits: list[int] = []) -> dict[str, float]
 
list[float] get_prob_list (self, list[int] qubits=...)
 get_prob_list(self: core.QResult, qubits: list[int] = []) -> list[float]
 
list[complex] get_state_vector (self)
 get_state_vector(self: core.QResult) -> list[complex]
 
None print_results (self)
 print_results(self: core.QResult) -> None
 
None reset (self)
 reset(self: core.QResult) -> None
 
int shots (self)
 shots(self: core.QResult) -> int
 
None store_measure_result (self)
 store_measure_result(self: core.QResult) -> None
 
None store_state_vector (self, list[complex] arg0)
 store_state_vector(self: core.QResult, arg0: list[complex]) -> None
 

Constructor & Destructor Documentation

◆ __init__()

None pyqpanda3.core.QResult.__init__ ( self)

init(self: core.QResult) -> None

Reimplemented in pyqpanda3.core.StabilizerResult.

Member Function Documentation

◆ add_result()

None pyqpanda3.core.QResult.add_result ( self,
int cbit_addr,
bool result )

add_result(self: core.QResult, cbit_addr: int, result: bool) -> None

Add a result to the QResult object.

Parameters
cbit_addrThe address of the classical bit.
resultThe measurement result corresponding to the classical bit.
Returns
None

◆ get_counts()

dict[str, int] pyqpanda3.core.QResult.get_counts ( self)

get_counts(self: core.QResult) -> dict[str, int]

Get the counts of measurement results.

Returns
A dictionary of counts for each possible result.

◆ get_measure_probs()

dict[str, float] pyqpanda3.core.QResult.get_measure_probs ( self)

get_measure_probs(self: core.QResult) -> dict[str, float]

Get the measurement probabilities.

Returns
A vector of probabilities for different measurement outcomes.

◆ get_prob_dict()

dict[str, float] pyqpanda3.core.QResult.get_prob_dict ( self,
list[int] qubits = ... )

get_prob_dict(self: core.QResult, qubits: list[int] = []) -> dict[str, float]

Get the dictionary of probabilities for specific qubits.

Parameters
qubitsA list of qubit indices to get the probabilities for.
Returns
A dictionary with qubit indices as keys and their probabilities as values.

◆ get_prob_list()

list[float] pyqpanda3.core.QResult.get_prob_list ( self,
list[int] qubits = ... )

get_prob_list(self: core.QResult, qubits: list[int] = []) -> list[float]

Get the list of probabilities for specific qubits.

Parameters
qubitsA list of qubit indices to get the probabilities for.
Returns
A list of probabilities.

◆ get_state_vector()

list[complex] pyqpanda3.core.QResult.get_state_vector ( self)

get_state_vector(self: core.QResult) -> list[complex]

Get the state vector of the quantum system.

Returns
A vector representing the state of the quantum system.

Reimplemented in pyqpanda3.core.StabilizerResult.

◆ print_results()

None pyqpanda3.core.QResult.print_results ( self)

print_results(self: core.QResult) -> None

Print the results of the quantum measurements.

Returns
None

◆ reset()

None pyqpanda3.core.QResult.reset ( self)

reset(self: core.QResult) -> None

Reset the result data.

Returns
None

◆ shots()

int pyqpanda3.core.QResult.shots ( self)

shots(self: core.QResult) -> int

Get the number of shots for the measurement.

Returns
The number of shots.

◆ store_measure_result()

None pyqpanda3.core.QResult.store_measure_result ( self)

store_measure_result(self: core.QResult) -> None

Store the measurement result.

Returns
None

◆ store_state_vector()

None pyqpanda3.core.QResult.store_state_vector ( self,
list[complex] arg0 )

store_state_vector(self: core.QResult, arg0: list[complex]) -> None

Store the state vector.

Returns
None

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