From 044ff6e0078845d61705d3e7b3c6a6e9061bdd41 Mon Sep 17 00:00:00 2001 From: Anurudh Peduri Date: Tue, 20 Aug 2024 14:31:24 -0700 Subject: [PATCH] reduce dependence on `_get_all_rotation_types` --- .../chemistry/trotter/hubbard/qpe_cost_optimization.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qualtran/bloqs/chemistry/trotter/hubbard/qpe_cost_optimization.ipynb b/qualtran/bloqs/chemistry/trotter/hubbard/qpe_cost_optimization.ipynb index a2fc00edf8..6f4e10cdd5 100644 --- a/qualtran/bloqs/chemistry/trotter/hubbard/qpe_cost_optimization.ipynb +++ b/qualtran/bloqs/chemistry/trotter/hubbard/qpe_cost_optimization.ipynb @@ -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", @@ -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",