1
- import cirq
2
- import numpy as np
3
- import scipy
4
- import sympy as sy
5
- import networkx as nx
6
- import tensorflow_quantum as tfq
7
- import tensorflow as tf
8
1
from functools import partial
9
- from functools import lru_cache
10
- import tensornetwork as tn
11
- from itertools import product
12
- import json
13
2
import sys
14
3
15
4
sys .path .insert (0 , "../" )
5
+
6
+ import numpy as np
7
+ import tensorflow as tf
8
+
16
9
import tensorcircuit as tc
17
- from tensorcircuit .applications .layers import *
18
- from tensorcircuit .applications .van import *
19
- from tensorcircuit .applications .graphdata import *
20
- from tensorcircuit .applications .dqas import *
21
- from tensorcircuit .applications .vags import *
22
- from tensorcircuit .applications .vqes import *
10
+ from tensorcircuit .applications .vqes import VQNHE , JointSchedule
23
11
24
12
tc .set_backend ("tensorflow" )
25
13
tc .set_dtype ("complex128" )
@@ -34,8 +22,8 @@ def initial_param(t, last=None, lastlast=None):
34
22
qw .numpy () + np .random .uniform (low = - 0.1 , high = 0.1 , size = qw .numpy ().shape )
35
23
)
36
24
cw = last [- 2 ]
37
- for i , t in enumerate (cw ):
38
- cw [i ] = t + np .random .uniform (low = - 0.1 , high = 0.1 , size = t .shape )
25
+ for i , b in enumerate (cw ):
26
+ cw [i ] = b + np .random .uniform (low = - 0.1 , high = 0.1 , size = t .shape )
39
27
return {"c" : cw , "q" : qw }
40
28
41
29
return {}
@@ -106,7 +94,7 @@ def learn_c():
106
94
if __name__ == "__main__" :
107
95
history = []
108
96
lihh = np .load ("data_file" )
109
- for i , h in enumerate ( lihh [3 :6 ]) :
97
+ for h in lihh [3 :6 ]:
110
98
history .append (adiabatic_range (h .tolist (), history ))
111
99
print (history )
112
100
# vqeinstance = VQNHE(
0 commit comments