About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
LinearSystemObservable
class LinearSystemObservable
Bases: abc.ABC
The deprecated abstract class for linear system observables in Qiskit.
Methods
evaluate_classically
abstract LinearSystemObservable.evaluate_classically(solution)
Calculates the analytical value of the given observable from the solution vector to the
linear system.
Parameters
solution (Union
[array
, QuantumCircuit
]) – The solution to the system as a numpy array or the circuit that prepares it.
Return type
float
Returns
The value of the observable.
observable
abstract LinearSystemObservable.observable(num_qubits)
The observable operator.
Parameters
num_qubits (int
) – The number of qubits on which the observable will be applied.
Return type
Union
[TensoredOp
, List
[TensoredOp
]]
Returns
The observable as a sum of Pauli strings.
observable_circuit
abstract LinearSystemObservable.observable_circuit(num_qubits)
The circuit implementing the observable.
Parameters
num_qubits (int
) – The number of qubits on which the observable will be applied.
Return type
Union
[QuantumCircuit
, List
[QuantumCircuit
]]
Returns
The observable as a QuantumCircuit.
post_processing
abstract LinearSystemObservable.post_processing(solution, num_qubits, scaling=1)
Evaluates the given observable on the solution to the linear system.
Parameters
- solution (
Union
[float
,List
[float
]]) – The probability calculated from the circuit and the observable. - num_qubits (
int
) – The number of qubits where the observable was applied. - scaling (
float
) – Scaling of the solution.
Return type
float
Returns
The value of the observable.
Was this page helpful?
Report a bug or request content on GitHub.