Skip to content

Commit

Permalink
Don't use black box QROAM in THC call graph. (#614)
Browse files Browse the repository at this point in the history
Don't use black box in THC call graph.
  • Loading branch information
fdmalone authored Feb 2, 2024
1 parent 79c324d commit 2c7bbed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions qualtran/bloqs/chemistry/thc/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
)
from qualtran.bloqs.basic_gates import Hadamard, Ry, Toffoli, XGate
from qualtran.bloqs.basic_gates.swap import CSwap
from qualtran.bloqs.chemistry.black_boxes import QROAM
from qualtran.bloqs.multi_control_multi_target_pauli import MultiControlPauli
from qualtran.bloqs.on_each import OnEach
from qualtran.bloqs.reflection import Reflection
Expand Down Expand Up @@ -435,8 +434,11 @@ def build_call_graph(self, ssa: 'SympySymbolAllocator') -> Set['BloqCountT']:
data_size = self.num_spin_orb // 2 + self.num_mu * (self.num_mu + 1) // 2
nd = (data_size - 1).bit_length()
cost_2 = (ToContiguousIndex(nmu, nd), 1)
m = 2 * nmu + 2 + self.keep_bitsize
cost_3 = (QROAM(data_size, m), 1)
qroam = SelectSwapQROM(
*(self.theta, self.alt_theta, self.alt_mu, self.alt_nu, self.keep),
target_bitsizes=(1, 1, nmu, nmu, self.keep_bitsize),
)
cost_3 = (qroam, 1)
cost_4 = (OnEach(self.keep_bitsize, Hadamard()), 1)
cost_5 = (LessThanEqual(self.keep_bitsize, self.keep_bitsize), 2)
cost_6 = (CSwap(nmu), 3)
Expand Down

0 comments on commit 2c7bbed

Please sign in to comment.