Example #1
0
def cost_function(qp, H, n_qubits, depth, entangler_map, shots, device, theta):
    trial_circuit = trial_circuit_ryrz(n_qubits, depth, theta, entangler_map,
                                       meas_string=None, measurement=False)

    energy = eval_hamiltonian(qp, H, trial_circuit, shots, device).real

    return energy
Example #2
0
def cost_function(qp, H, n_qubits, depth, entangler_map, shots, device, theta):
    trial_circuit = trial_circuit_ryrz(n_qubits, depth, theta, entangler_map,
                                       meas_string=None, measurement=False)

    energy = eval_hamiltonian(qp, H, trial_circuit, shots, device).real

    return energy
Example #3
0
 def cost_function(Q_program, H, n, m, entangler_map, shots, device,
                   theta):
     # pylint: disable=missing-docstring
     return eval_hamiltonian(
         Q_program, H,
         trial_circuit_ryrz(n, m, theta, entangler_map, None, False),
         shots, device).real
Example #4
0
 def cost_function(Q_program, H, n, m, entangler_map, shots, device, theta):
     # pylint: disable=missing-docstring
     return eval_hamiltonian(Q_program, H,
                             trial_circuit_ryrz(n, m, theta, entangler_map, None, False),
                             shots, device).real