File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
torchquantum/operator/standard_gates Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 5454from .xx_min_yy import XXMINYY
5555from .xx_plus_yy import XXPLUSYY
5656
57- all_variables = [
57+ _all_variables = [
5858 EchoedCrossResonance ,
5959 ECR ,
6060 GlobalPhase ,
127127 XXPLUSYY ,
128128]
129129
130- __all__ = [a ().__class__ .__name__ for a in all_variables ]
131-
132- # add the aliased and incomptaible classes
133- __all__ .extend (["U" , "CH" , "QubitUnitary" , "QubitUnitaryFast" ])
134-
135- # add the dictionary
136- __all__ .extend (["op_name_dict" , "fixed_ops" , "parameterized_ops" ])
137-
138130# create the operations dictionary
139- op_name_dict = {x .op_name : x for x in all_variables }
131+ op_name_dict = {_x .op_name : _x for _x in _all_variables }
140132
141133# add aliases as well
142134op_name_dict .update (
161153 }
162154)
163155
164- fixed_ops = [a ().__class__ .__name__ for a in all_variables if a .num_params == 0 ]
165- parameterized_ops = [a ().__class__ .__name__ for a in all_variables if a .num_params > 0 ]
156+ # TODO: make this compatible with aliases
157+ fixed_ops = [_a ().__class__ .__name__ for _a in _all_variables if _a .num_params == 0 ]
158+ parameterized_ops = [_a ().__class__ .__name__ for _a in _all_variables if _a .num_params > 0 ]
You can’t perform that action at this time.
0 commit comments