Skip to content

Commit

Permalink
reduce dependence on _get_all_rotation_types
Browse files Browse the repository at this point in the history
  • Loading branch information
anurudhp committed Aug 20, 2024
1 parent da05b45 commit 044ff6e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"import numpy as np\n",
"import sympy\n",
"\n",
"from qualtran.resource_counting.t_counts_from_sigma import _get_all_rotation_types\n",
"from qualtran.resource_counting.classify_bloqs import bloq_is_rotation\n",
"from qualtran.resource_counting.generalizers import PHI\n",
"from qualtran.cirq_interop.t_complexity_protocol import TComplexity\n",
"from qualtran import Bloq\n",
Expand All @@ -130,11 +130,10 @@
"\n",
"\n",
"def t_and_rot_counts_from_sigma(sigma: Dict['Bloq', Union[int, 'sympy.Expr']]) -> Tuple[int, int]:\n",
" rotation_types = _get_all_rotation_types()\n",
" ret = sigma.get(TGate(), 0)\n",
" n_rot = 0\n",
" for bloq, counts in sigma.items():\n",
" if isinstance(bloq, rotation_types):\n",
" if bloq_is_rotation(bloq):\n",
" n_rot += counts\n",
" return ret, n_rot\n",
"\n",
Expand Down

0 comments on commit 044ff6e

Please sign in to comment.