qiskit/tools/apps/optimization.py
def Energy_Estimate(data, pauli_list):
    """Compute expectation value of a list of diagonal Paulis with
    coefficients given measurement data. If somePaulis are non-diagonal
    appropriate post-rotations had to be performed in the collection of data

    Args:
        data (dict): output of the execution of a quantum program
        pauli_list (list): list of [coeff, Pauli]
    Returns:
        float: The expectation value
    """
    energy = 0
    if np.ndim(pauli_list) == 1:
        energy = pauli_list[0] * measure_pauli_z(data, pauli_list[1])
    else:
        for p in pauli_list:
            energy += p[0] * measure_pauli_z(data, p[1])
    return energy
Compute expectation value of a list of diagonal Paulis with
    coefficients given measurement data. If somePaulis are non-diagonal
    appropriate post-rotations had to be performed in the collection of data

    Args:
        data (dict): output of the execution of a quantum program
        pauli_list (list): list of [coeff, Pauli]
    Returns:
        float: The expectation value
    
Compute expectation value of a list of diagonal Paulis with
coefficients given measurement data. If somePaulis are non-diagonal
appropriate post-rotations had to be performed in the collection of data
Compute expectation value of a list of diagonal Paulis with coefficients given measurement data . If somePaulis are non - diagonal appropriate post - rotations had to be performed in the collection of data
def Energy_Estimate(data, pauli_list):
    energy = 0
    if np.ndim(pauli_list) == 1:
        energy = pauli_list[0] * measure_pauli_z(data, pauli_list[1])
    else:
        for p in pauli_list:
            energy += p[0] * measure_pauli_z(data, p[1])
    return energy
def Energy_Estimate ( data , pauli_list ) : energy = 0 if np . ndim ( pauli_list ) == 1 : energy = pauli_list [ 0 ] * measure_pauli_z ( data , pauli_list [ 1 ] ) else : for p in pauli_list : energy += p [ 0 ] * measure_pauli_z ( data , p [ 1 ] ) return energy
Compute expectation value of a list of diagonal Paulis with
coefficients given measurement data.
Compute expectation value of a list of diagonal Paulis with coefficients given measurement data .
"""Compute expectation value of a list of diagonal Paulis with
    coefficients given measurement data. If somePaulis are non-diagonal
    appropriate post-rotations had to be performed in the collection of data

    Args:
        data (dict): output of the execution of a quantum program
        pauli_list (list): list of [coeff, Pauli]
    Returns:
        float: The expectation value
    """
The expectation value
The expectation value
float
data
output of the execution of a quantum program
output of the execution of a quantum program
pauli_list
list of [coeff, Pauli]
list of [ coeff Pauli ]