pre meeting
This commit is contained in:
@@ -16,7 +16,7 @@ def Mi(nqbits, i, M):
|
||||
|
||||
|
||||
def H_interaction(nqbits):
|
||||
interaction_terms = [Mi(nqbits, i, Z) @ Mi(nqbits, i+1, Z) for i in range(nqbits)]
|
||||
interaction_terms = [Mi(nqbits, i, Z) @ Mi(nqbits, i+1, Z) for i in range(nqbits - 1)]
|
||||
return sum(interaction_terms)
|
||||
|
||||
def H_field(nqbits, g):
|
||||
|
@@ -20,8 +20,8 @@ matplotlib.rcParams.update(
|
||||
nqbits = 6
|
||||
g = 3
|
||||
N_trot = 80
|
||||
t_stop = 9
|
||||
delta_t = 0.09
|
||||
t_stop = 29
|
||||
delta_t = 0.1
|
||||
qbits = list(range(nqbits))
|
||||
|
||||
n_sample = 2200
|
||||
@@ -49,8 +49,8 @@ for t in np.arange(0, t_stop, delta_t):
|
||||
|
||||
errors_sampling.append(bootstrap(result[0], n_sample, n_sample, n_sample // 2, np.average))
|
||||
|
||||
#amplitude = np.sum(np.abs(state._qm_state[measure_coefficient_mask])**2)
|
||||
#amplitudes_qc.append(amplitude)
|
||||
amplitude = np.sum(np.abs(state._qm_state[measure_coefficient_mask])**2)
|
||||
amplitudes_qc.append(amplitude)
|
||||
|
||||
# Simulation using matrices
|
||||
np_zero_state = np.zeros(2**nqbits)
|
||||
@@ -68,11 +68,17 @@ print()
|
||||
print("done.")
|
||||
|
||||
results_qc = np.array(results_qc)
|
||||
amplitudes_qc = np.array(amplitudes_qc)
|
||||
|
||||
errors_trotter = (np.arange(0, t_stop, delta_t) * g)**3 / N_trot**3
|
||||
errors_trotter = (np.arange(0, t_stop, delta_t))**3 / N_trot**3
|
||||
errors_sampling = np.array(errors_sampling)
|
||||
#errors_sampling = np.abs(results_qc - amplitudes_qc)
|
||||
#errors_sampling = (amplitudes_qc * (1 - amplitudes_qc))**2 / n_sample
|
||||
|
||||
|
||||
#hm1 = plt.errorbar(np.arange(0, t_stop, delta_t)
|
||||
# , results_qc
|
||||
# , yerr=(errors_sampling + errors_trotter)
|
||||
# , color="red")
|
||||
h0 = plt.errorbar(np.arange(0, t_stop, delta_t)
|
||||
, results_qc
|
||||
, yerr=errors_sampling
|
||||
|
Reference in New Issue
Block a user