squlearn.util.optree
.OpTreeMeasuredOperator
- class squlearn.util.optree.OpTreeMeasuredOperator(circuit: OpTreeCircuit | QuantumCircuit, operator: OpTreeOperator | SparsePauliOp)
Leaf of the OpTree that represents an measurement.
The circuit in the class represents the circuit that is measured for the given operator.
- copy()
Function for copying a OpTreeLeafMeasuredOperator object.
- measure_circuit(circuit: QuantumCircuit | OpTreeCircuit) OpTreeExpectationValue
Applies the measurement of the leaf to the circuit and returns an expectation value.
- Parameters:
circuit (Union[QuantumCircuit, OpTreeLeafCircuit]) – The circuit that is measured.
- Returns:
The expectation value leaf with the measured circuit.
- Return type:
OpTreeLeafExpectationValue