Beispiel #1
0
def energy_along_flat(a, b):
    ansatz_state = qnnops.alternating_layer_ansatz(origin + a * dx + b * dy,
                                                   n_qubits=cfg.n_qubits,
                                                   block_size=cfg.n_qubits,
                                                   n_layers=cfg.n_layers,
                                                   rot_axis=cfg.rot_axis)
    return qnnops.energy(ham_matrix, ansatz_state) - eigval[0]
Beispiel #2
0
 def loss(_params):
     ansatz_state = qnnops.alternating_layer_ansatz(_params, n_qubits,
                                                    block_size, n_layers,
                                                    rot_axis)
     return qnnops.energy(ham_matrix, ansatz_state)
Beispiel #3
0
 def loss_fn(params):
     ansatz_state = qnnops.alternating_layer_ansatz(params, n_qubits,
                                                    n_qubits, n_layers,
                                                    args.rot_axis)
     return qnnops.energy(ham_matrix, ansatz_state)
Beispiel #4
0
def circuit(params):
    return qnnops.alternating_layer_ansatz(
        params, n_qubits=n_qubits, block_size=block_size, n_layers=n_layers, rot_axis=rot_axis)
 def loss_fn(params):
     ansatz_state = qnnops.alternating_layer_ansatz(
         params, config.n_qubits, config.n_qubits, config.n_layers, config.rot_axis)
     return qnnops.energy(ham_matrix, ansatz_state) - ground_energy