-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.py
More file actions
52 lines (40 loc) · 1.82 KB
/
Copy pathconfig.py
File metadata and controls
52 lines (40 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
my_method = "Trotter"
#my_method = "double-factorization"
# this configuration file assumes equipartition of energy between Trotterization error and phase
# estimation error (see usage of energy_error below)
energy_error = meV_to_Hartree(1e4) # 0.01 keV
# _________________________________________________________________________________________________
# general
general.print_verbose()
general.logfile = "Be-H.log"
# _________________________________________________________________________________________________
# hamiltonian
hamiltonian.load_second_quantization("examples/Be-H_1.30_sto-6g_as-003-003.tensors.npz")
# _________________________________________________________________________________________________
# unitary encoding
if my_method == "Trotter":
unitary.encode_ramped_trotter(
energy_error = 0.5 * energy_error,
error_scale = 1.0,
trotter_implementation = "flattened",
trotter_combine_terms = True,
ordering_method = "lexicographical"
)
elif my_method == "double-factorization":
unitary.encode_double_factorization(energy_error=1.0e-4)
else:
raise ValueError(f"Invalid value for `my_method`: \"{my_method}\"")
# _________________________________________________________________________________________________
# algorithm
if my_method == "Trotter":
algorithm.method = "QPE: qualtran textbook"
algorithm.energy_error = 0.5 * energy_error
algorithm.probability_of_failure = 0.01
elif my_method == "double-factorization":
algorithm.method = "QPE: pyLIQTR qubitized"
algorithm.num_phase_qubits = 12
else:
raise ValueError(f"Invalid value for `my_method`: \"{my_method}\"")
# _________________________________________________________________________________________________
# analysis
analysis.resource_estimator = "pyLIQTR"