Skip to content

Commit 078b827

Browse files
authored
Update quantum_variation.py
1 parent fc651a6 commit 078b827

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/quantum_variation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
tc.set_backend("tensorflow")
77
tc.set_dtype("complex64")
88

9+
910
# realize R gates in paper
1011
def R_gate(k, c, ODE_theta):
1112
if door[k][0] == 0:
@@ -135,6 +136,7 @@ def Calculation_C(theta_x, is_k, is_q, ODE_theta):
135136

136137
Calculation_C_vmap = tc.backend.vmap(Calculation_C, vectorized_argnums=[0, 1, 2])
137138

139+
138140
# use original quantum circuit simulate with c
139141
def simulation():
140142
c = tc.Circuit(N, inputs=state)
@@ -167,7 +169,6 @@ def numdiff(i):
167169

168170

169171
if __name__ == "__main__":
170-
171172
# l: layers; h and J: coefficient of Hamilton; L_var and L_num: results of variation method and numerical method
172173
N = 3
173174
l = 2

0 commit comments

Comments
 (0)