8
8
9
9
import qforte as qf
10
10
11
- from qforte .utils .state_prep import build_Uprep
11
+ from qforte .utils .state_prep import build_refprep
12
12
from qforte .utils .trotterization import trotterize
13
13
from qforte .utils .compact_excitation_circuits import compact_excitation_circuit
14
14
from qforte .abc .mixin import Trotterizable
@@ -101,12 +101,12 @@ def build_orb_energies(self):
101
101
print ("\n Building single-particle energies:" )
102
102
print ("---------------------------------------" , flush = True )
103
103
qc = qf .Computer (self ._nqb )
104
- qc .apply_circuit (build_Uprep ( self ._ref , "occupation_list" ) )
104
+ qc .apply_circuit (self ._refprep )
105
105
E0 = qc .direct_op_exp_val (self ._qb_ham )
106
106
107
107
for i in range (self ._nqb ):
108
108
qc = qf .Computer (self ._nqb )
109
- qc .apply_circuit (build_Uprep ( self ._ref , "occupation_list" ) )
109
+ qc .apply_circuit (self ._refprep )
110
110
qc .apply_gate (qf .gate ("X" , i , i ))
111
111
Ei = qc .direct_op_exp_val (self ._qb_ham )
112
112
@@ -119,7 +119,7 @@ def build_orb_energies(self):
119
119
self ._orb_e .append (ei )
120
120
121
121
def get_res_over_mpdenom (self , residuals ):
122
- """This function returns a vector given by the residuals dividied by the
122
+ """This function returns a vector given by the residuals divided by the
123
123
respective Moller Plesset denominators.
124
124
125
125
Parameters
@@ -136,7 +136,7 @@ def get_res_over_mpdenom(self, residuals):
136
136
sq_op = self ._pool_obj [m ][1 ]
137
137
138
138
temp_idx = sq_op .terms ()[0 ][2 ][- 1 ]
139
- if temp_idx < int ( sum ( self ._ref ) / 2 ) : # if temp_idx is an occupied idx
139
+ if self ._ref [ temp_idx ] : # if temp_idx is an occupied idx
140
140
sq_creators = sq_op .terms ()[0 ][1 ]
141
141
sq_annihilators = sq_op .terms ()[0 ][2 ]
142
142
else :
0 commit comments