Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions qualtran/bloqs/util_bloqs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import subprocess
from functools import cached_property
from typing import Dict, Type, Union

Expand Down Expand Up @@ -290,3 +291,8 @@ def to_cirq_circuit(bloq: GateWithRegisters) -> cirq.Circuit:
@pytest.mark.notebook
def test_notebook():
execute_notebook('util_bloqs')


def test_no_circular_import():
# There was a circular import that would only be triggered by this import incantation
subprocess.check_call(['python', '-c', 'from qualtran.bloqs import util_bloqs'])
11 changes: 5 additions & 6 deletions qualtran/resource_counting/t_counts_from_sigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@

import cirq

from qualtran.bloqs.basic_gates.rotation import _HasEps
from qualtran.resource_counting.symbolic_counting_utils import ceil, SymbolicInt

if TYPE_CHECKING:
import sympy

from qualtran import Bloq
from qualtran.bloqs.basic_gates.rotation import _HasEps


def _get_all_rotation_types() -> Tuple[Type[_HasEps], ...]:
def _get_all_rotation_types() -> Tuple[Type['_HasEps'], ...]:
"""Returns all classes defined in bloqs.basic_gates which have an attribute `eps`."""
import qualtran.bloqs.basic_gates # pylint: disable=unused-import
from qualtran.bloqs.basic_gates import GlobalPhase
from qualtran.bloqs.basic_gates.rotation import _HasEps

bloqs_to_exclude = [qualtran.bloqs.basic_gates.GlobalPhase]
bloqs_to_exclude = [GlobalPhase]

return tuple(
v
Expand Down