def costfunc(circuit_evals, proportions):
    """Takes the expectation values of the circuit evaluations and adds them according to the proportion
    Arguments:
        circuit_evals :[Float]: the expectation values
        proportions :[Float]: the mixing coefficients
    """
    loss = 0
    for circ_eval, prop in zip(circuit_evals,proportions):
        loss += circ_eval * prop
    return loss