1818import cirq
1919import numpy as np
2020
21- from qualtran import Bloq , bloq_example , BloqDocSpec , GateWithRegisters , Register , Signature
21+ from qualtran import (
22+ Bloq ,
23+ bloq_example ,
24+ BloqDocSpec ,
25+ CtrlSpec ,
26+ GateWithRegisters ,
27+ Register ,
28+ Signature ,
29+ )
2230from qualtran .bloqs .phase_estimation .qpe_window_state import QPEWindowStateBase
2331from qualtran .bloqs .qft .qft_text_book import QFTTextBook
2432from qualtran .bloqs .qubitization .qubitization_walk_operator import QubitizationWalkOperator
@@ -108,8 +116,8 @@ def decompose_from_registers(
108116 walk_regs = {reg .name : quregs [reg .name ] for reg in self .walk .signature }
109117 reflect_regs = {reg .name : walk_regs [reg .name ] for reg in self .walk .reflect .signature }
110118
111- reflect_controlled = self .walk .reflect .controlled (control_values = [ 0 ] )
112- walk_controlled = self .walk .controlled (control_values = [ 1 ] )
119+ reflect_controlled = self .walk .reflect .controlled (ctrl_spec = CtrlSpec ( cvs = 0 ) )
120+ walk_controlled = self .walk .controlled ()
113121
114122 qpre_reg = quregs ['qpe_reg' ]
115123
@@ -128,8 +136,8 @@ def build_call_graph(self, ssa: 'SympySymbolAllocator') -> Set['BloqCountT']:
128136 M = 2 ** self .m_bits
129137 return {
130138 (self .ctrl_state_prep , 1 ),
131- (self .walk .controlled (control_values = [ 1 ] ), 1 ),
132- (self .walk .reflect .controlled (control_values = [ 0 ] ), 2 * (self .m_bits - 1 )),
139+ (self .walk .controlled (), 1 ),
140+ (self .walk .reflect .controlled (ctrl_spec = CtrlSpec ( cvs = 0 ) ), 2 * (self .m_bits - 1 )),
133141 (self .walk , M - 2 ),
134142 (self .qft_inv , 1 ),
135143 }
0 commit comments