def METHOD_NAME(
    self, ansatz: QuantumCircuit, observables: ListOrDict[BaseOperator | PauliSumOp]
):
    """
    Calculates the exact expectation to be used as an expected result for unit tests.
    """
    if isinstance(observables, dict):
        observables_list = list(observables.values())
    else:
        observables_list = observables
    # the exact value is a list of (mean, (variance, shots)) where we expect 0 variance and
    # 0 shots
    exact = [
        (Statevector(ansatz).expectation_value(observable), {})
        for observable in observables_list
    ]
    if isinstance(observables, dict):
        return dict(zip(observables.keys(), exact))
    return exact