squlearn.util.optree
.OpTreeExpectationValue
- class squlearn.util.optree.OpTreeExpectationValue(circuit: OpTreeCircuit | QuantumCircuit, operator: OpTreeOperator | SparsePauliOp)
Leaf of the OpTree that represents an expectation value of a circuit and an operator.
- Parameters:
circuit (Union[OpTreeLeafCircuit, QuantumCircuit]) – The circuit in the expectation value.
operator (Union[OpTreeLeafOperator, SparsePauliOp]) – The operator in the expectation value.
- copy()
Function for copying a OpTreeLeafExpectationValue object.