From 1a68e8e7919487f1465cc587b9855cb43169f63d Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Tue, 12 Nov 2024 14:03:08 +0000 Subject: [PATCH] refactor!: rename prelude to std (#642) Closes #430 The following is for release-please Release-As: 0.13.0 BREAKING CHANGE: `prelude` module renamed to `std` --- examples/demo.ipynb | 16 ++++++++-------- examples/random_walk_qpe.py | 8 ++++---- examples/t_factory.py | 8 ++++---- guppylang/__init__.py | 6 +++--- guppylang/compiler/expr_compiler.py | 2 +- guppylang/module.py | 4 ++-- guppylang/{prelude => std}/__init__.py | 0 guppylang/{prelude => std}/_internal/__init__.py | 0 guppylang/{prelude => std}/_internal/checker.py | 2 +- guppylang/{prelude => std}/_internal/compiler.py | 0 .../_internal/compiler/__init__.py | 0 .../_internal/compiler/arithmetic.py | 12 ++++++------ .../{prelude => std}/_internal/compiler/array.py | 4 ++-- .../{prelude => std}/_internal/compiler/list.py | 4 ++-- .../_internal/compiler/prelude.py | 0 .../_internal/compiler/quantum.py | 4 ++-- guppylang/{prelude => std}/_internal/util.py | 2 +- guppylang/{prelude => std}/angles.py | 2 +- guppylang/{prelude => std}/builtins.py | 10 +++++----- guppylang/{prelude => std}/quantum.py | 8 ++++---- guppylang/{prelude => std}/quantum_functional.py | 10 +++++----- .../error/array_errors/new_array_cannot_infer.py | 4 ++-- tests/error/array_errors/new_array_check_fail.py | 4 ++-- .../array_errors/new_array_elem_mismatch1.py | 4 ++-- .../array_errors/new_array_elem_mismatch2.py | 4 ++-- .../error/array_errors/new_array_wrong_length.py | 4 ++-- tests/error/array_errors/subscript_after_use.py | 6 +++--- tests/error/array_errors/subscript_drop.py | 6 +++--- tests/error/array_errors/subscript_non_inout.py | 6 +++--- tests/error/array_errors/use_after_subscript.py | 6 +++--- tests/error/comprehension_errors/capture1.py | 6 +++--- tests/error/comprehension_errors/capture2.py | 6 +++--- tests/error/comprehension_errors/capture3.py | 6 +++--- tests/error/comprehension_errors/capture4.py | 6 +++--- tests/error/comprehension_errors/guarded1.py | 6 +++--- tests/error/comprehension_errors/guarded2.py | 6 +++--- tests/error/comprehension_errors/guarded3.py | 6 +++--- tests/error/comprehension_errors/multi_use1.py | 6 +++--- tests/error/comprehension_errors/multi_use2.py | 6 +++--- tests/error/comprehension_errors/multi_use3.py | 6 +++--- tests/error/comprehension_errors/not_used1.py | 6 +++--- tests/error/comprehension_errors/not_used2.py | 6 +++--- .../comprehension_errors/pattern_override1.py | 6 +++--- .../comprehension_errors/pattern_override2.py | 6 +++--- tests/error/comprehension_errors/used_twice1.py | 6 +++--- tests/error/comprehension_errors/used_twice2.py | 6 +++--- tests/error/comprehension_errors/used_twice3.py | 6 +++--- tests/error/inout_errors/already_used.py | 4 ++-- tests/error/inout_errors/conflict.py | 4 ++-- tests/error/inout_errors/drop_after_call.py | 2 +- tests/error/inout_errors/moved.py | 4 ++-- tests/error/inout_errors/moved_assign.py | 2 +- tests/error/inout_errors/moved_if.py | 4 ++-- tests/error/inout_errors/moved_out.py | 4 ++-- tests/error/inout_errors/moved_out_if.py | 4 ++-- .../inout_errors/nested_call_right_to_left.py | 4 ++-- tests/error/inout_errors/nonlinear.py | 4 ++-- tests/error/inout_errors/nonlinear_callable.py | 2 +- tests/error/inout_errors/override_after_call.py | 4 ++-- tests/error/inout_errors/shadow.py | 4 ++-- tests/error/inout_errors/shadow_if.py | 4 ++-- tests/error/inout_errors/struct_constructor.py | 2 +- .../error/inout_errors/subscript_not_setable.py | 4 ++-- tests/error/inout_errors/unused_after_call.py | 4 ++-- tests/error/linear_errors/branch_use.py | 6 +++--- tests/error/linear_errors/branch_use_field1.py | 4 ++-- tests/error/linear_errors/branch_use_field2.py | 6 +++--- tests/error/linear_errors/break_unused.py | 6 +++--- tests/error/linear_errors/call_drop_field.py | 4 ++-- tests/error/linear_errors/continue_unused.py | 6 +++--- tests/error/linear_errors/copy_qubit.py | 6 +++--- tests/error/linear_errors/field_copy1.py | 6 +++--- tests/error/linear_errors/field_copy2.py | 6 +++--- tests/error/linear_errors/field_copy3.py | 6 +++--- tests/error/linear_errors/field_copy_nested1.py | 6 +++--- tests/error/linear_errors/field_copy_nested2.py | 6 +++--- tests/error/linear_errors/field_copy_nested3.py | 6 +++--- tests/error/linear_errors/field_copy_nested4.py | 6 +++--- tests/error/linear_errors/for_break.py | 6 +++--- tests/error/linear_errors/for_return.py | 6 +++--- tests/error/linear_errors/if_both_unused.py | 4 ++-- .../error/linear_errors/if_both_unused_field.py | 4 ++-- .../linear_errors/if_both_unused_reassign.py | 4 ++-- .../if_both_unused_reassign_field.py | 6 +++--- tests/error/linear_errors/method_capture.py | 6 +++--- tests/error/linear_errors/reassign_unused.py | 6 +++--- .../error/linear_errors/reassign_unused_field.py | 6 +++--- .../error/linear_errors/reassign_unused_tuple.py | 6 +++--- tests/error/linear_errors/unused.py | 6 +++--- tests/error/linear_errors/unused_expr.py | 6 +++--- tests/error/linear_errors/unused_field1.py | 6 +++--- tests/error/linear_errors/unused_field2.py | 6 +++--- tests/error/linear_errors/unused_field3.py | 6 +++--- tests/error/linear_errors/unused_same_block.py | 6 +++--- tests/error/linear_errors/while_unused.py | 4 ++-- tests/error/misc_errors/extern_bad_type.py | 4 ++-- tests/error/misc_errors/invalid_arg_flag.py | 4 ++-- tests/error/misc_errors/negative_nat_arg.py | 2 +- tests/error/misc_errors/nested_arg_flag.py | 4 ++-- .../misc_errors/result_array_not_numeric.py | 2 +- tests/error/misc_errors/result_tag_not_static.py | 2 +- tests/error/misc_errors/result_tag_not_str.py | 2 +- tests/error/misc_errors/result_tag_too_big.py | 2 +- tests/error/misc_errors/result_value_linear.py | 6 +++--- tests/error/misc_errors/return_flag.py | 4 ++-- tests/error/misc_errors/return_flag_callable.py | 4 ++-- tests/error/nested_errors/linear_capture.py | 6 +++--- tests/error/poly_errors/arg_mismatch3.py | 2 +- tests/error/poly_errors/arg_mismatch4.py | 2 +- tests/error/poly_errors/non_linear1.py | 4 ++-- tests/error/poly_errors/non_linear2.py | 4 ++-- tests/error/poly_errors/non_linear3.py | 2 +- tests/error/py_errors/invalid_type_arg.py | 2 +- tests/error/py_errors/tket2_not_installed.py | 2 +- tests/error/struct_errors/mutate_classical.py | 2 +- tests/error/type_errors/subscript_bad_item.py | 2 +- tests/integration/modules/mod_b.py | 2 +- tests/integration/test_arithmetic.py | 4 ++-- tests/integration/test_array.py | 6 +++--- tests/integration/test_comprehension.py | 8 ++++---- tests/integration/test_inout.py | 6 +++--- tests/integration/test_linear.py | 8 ++++---- tests/integration/test_list.py | 10 +++++----- tests/integration/test_poly.py | 6 +++--- tests/integration/test_py.py | 8 +++----- tests/integration/test_qalloc.py | 8 ++++---- tests/integration/test_quantum.py | 8 ++++---- tests/integration/test_range.py | 3 +-- tests/integration/test_result.py | 2 +- tests/integration/test_tket.py | 10 +++++----- 130 files changed, 316 insertions(+), 319 deletions(-) rename guppylang/{prelude => std}/__init__.py (100%) rename guppylang/{prelude => std}/_internal/__init__.py (100%) rename guppylang/{prelude => std}/_internal/checker.py (99%) rename guppylang/{prelude => std}/_internal/compiler.py (100%) rename guppylang/{prelude => std}/_internal/compiler/__init__.py (100%) rename guppylang/{prelude => std}/_internal/compiler/arithmetic.py (96%) rename guppylang/{prelude => std}/_internal/compiler/array.py (98%) rename guppylang/{prelude => std}/_internal/compiler/list.py (99%) rename guppylang/{prelude => std}/_internal/compiler/prelude.py (100%) rename guppylang/{prelude => std}/_internal/compiler/quantum.py (95%) rename guppylang/{prelude => std}/_internal/util.py (98%) rename guppylang/{prelude => std}/angles.py (97%) rename guppylang/{prelude => std}/builtins.py (98%) rename guppylang/{prelude => std}/quantum.py (95%) rename guppylang/{prelude => std}/quantum_functional.py (93%) diff --git a/examples/demo.ipynb b/examples/demo.ipynb index a3e64f47..331c370a 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -76,7 +76,7 @@ "id": "2150bc3a", "metadata": {}, "source": [ - "Guppy provides a special `qubit` type that quantum operations act on. Quantum operations become available once we import and load the `guppylang.prelude.quantum` module." + "Guppy provides a special `qubit` type that quantum operations act on. Quantum operations become available once we import and load the `guppylang.std.quantum` module." ] }, { @@ -86,8 +86,8 @@ "metadata": {}, "outputs": [], "source": [ - "from guppylang.prelude.builtins import owned\n", - "from guppylang.prelude.quantum import qubit, measure, h, cx\n", + "from guppylang.std.builtins import owned\n", + "from guppylang.std.quantum import qubit, measure, h, cx\n", "\n", "module.load(qubit, h, cx, measure)\n", "\n", @@ -324,7 +324,7 @@ ], "source": [ "bad_module = GuppyModule(name=\"bad_module\")\n", - "bad_module.load_all(guppylang.prelude.quantum)\n", + "bad_module.load_all(guppylang.std.quantum)\n", "\n", "@guppy(bad_module)\n", "def bad(q: qubit @owned) -> qubit:\n", @@ -371,7 +371,7 @@ ], "source": [ "bad_module = GuppyModule(name=\"bad_module\")\n", - "bad_module.load_all(guppylang.prelude.quantum)\n", + "bad_module.load_all(guppylang.std.quantum)\n", "\n", "@guppy(bad_module)\n", "def bad(q: qubit @owned) -> qubit:\n", @@ -435,7 +435,7 @@ "outputs": [], "source": [ "module = GuppyModule(\"structs\")\n", - "module.load_all(guppylang.prelude.quantum)\n", + "module.load_all(guppylang.std.quantum)\n", "\n", "@guppy.struct(module)\n", "class QubitPair:\n", @@ -570,7 +570,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "venv", "language": "python", "name": "python3" }, @@ -584,7 +584,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.12.5" } }, "nbformat": 4, diff --git a/examples/random_walk_qpe.py b/examples/random_walk_qpe.py index 0e74ace4..0b7f2558 100644 --- a/examples/random_walk_qpe.py +++ b/examples/random_walk_qpe.py @@ -10,10 +10,10 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.angles import angle -from guppylang.prelude.builtins import owned, py, result -from guppylang.prelude.quantum import discard, measure, qubit -from guppylang.prelude.quantum_functional import cx, h, rz, x +from guppylang.std.angles import angle +from guppylang.std.builtins import owned, py, result +from guppylang.std.quantum import discard, measure, qubit +from guppylang.std.quantum_functional import cx, h, rz, x sqrt_e = math.sqrt(math.e) diff --git a/examples/t_factory.py b/examples/t_factory.py index 077cb5fa..5d274efe 100644 --- a/examples/t_factory.py +++ b/examples/t_factory.py @@ -1,14 +1,14 @@ import numpy as np from guppylang.decorator import guppy -from guppylang.prelude.angles import angle, pi -from guppylang.prelude.builtins import owned, py -from guppylang.prelude.quantum import ( +from guppylang.std.angles import angle, pi +from guppylang.std.builtins import owned, py +from guppylang.std.quantum import ( discard, measure, qubit, ) -from guppylang.prelude.quantum_functional import ( +from guppylang.std.quantum_functional import ( cz, h, rx, diff --git a/guppylang/__init__.py b/guppylang/__init__.py index 05558996..36619792 100644 --- a/guppylang/__init__.py +++ b/guppylang/__init__.py @@ -1,9 +1,9 @@ from guppylang.decorator import guppy from guppylang.experimental import enable_experimental_features from guppylang.module import GuppyModule -from guppylang.prelude import builtins, quantum -from guppylang.prelude.builtins import Bool, Float, Int, List, py -from guppylang.prelude.quantum import qubit +from guppylang.std import builtins, quantum +from guppylang.std.builtins import Bool, Float, Int, List, py +from guppylang.std.quantum import qubit # This is updated by our release-please workflow, triggered by this # annotation: x-release-please-version diff --git a/guppylang/compiler/expr_compiler.py b/guppylang/compiler/expr_compiler.py index 2f09bece..5eaed826 100644 --- a/guppylang/compiler/expr_compiler.py +++ b/guppylang/compiler/expr_compiler.py @@ -40,7 +40,7 @@ TensorCall, TypeApply, ) -from guppylang.prelude._internal.compiler.list import ( +from guppylang.std._internal.compiler.list import ( list_new, list_push, ) diff --git a/guppylang/module.py b/guppylang/module.py index 6939b1ae..792270c6 100644 --- a/guppylang/module.py +++ b/guppylang/module.py @@ -98,7 +98,7 @@ def __init__(self, name: str, import_builtins: bool = True): # Import builtin module if import_builtins: - import guppylang.prelude.builtins as builtins + import guppylang.std.builtins as builtins # Std lib is allowed to use experimental features with enable_experimental_features(): @@ -348,7 +348,7 @@ def compile(self) -> ModulePointer: # compute this dynamically from the imported dependencies instead. # # The hugr prelude and std_extensions are implicit. - from guppylang.prelude._internal.compiler.quantum import TKET2_EXTENSIONS + from guppylang.std._internal.compiler.quantum import TKET2_EXTENSIONS extensions = [*TKET2_EXTENSIONS, guppylang.compiler.hugr_extension.EXTENSION] diff --git a/guppylang/prelude/__init__.py b/guppylang/std/__init__.py similarity index 100% rename from guppylang/prelude/__init__.py rename to guppylang/std/__init__.py diff --git a/guppylang/prelude/_internal/__init__.py b/guppylang/std/_internal/__init__.py similarity index 100% rename from guppylang/prelude/_internal/__init__.py rename to guppylang/std/_internal/__init__.py diff --git a/guppylang/prelude/_internal/checker.py b/guppylang/std/_internal/checker.py similarity index 99% rename from guppylang/prelude/_internal/checker.py rename to guppylang/std/_internal/checker.py index b1bd4cbe..bd1d95df 100644 --- a/guppylang/prelude/_internal/checker.py +++ b/guppylang/std/_internal/checker.py @@ -297,7 +297,7 @@ def synthesize(self, args: list[ast.expr]) -> tuple[ast.expr, Type]: return range_iter, range_ty def range_ty(self) -> StructType: - from guppylang.prelude.builtins import Range + from guppylang.std.builtins import Range def_id = cast(RawStructDef, Range).id range_type_def = self.ctx.globals.defs[def_id] diff --git a/guppylang/prelude/_internal/compiler.py b/guppylang/std/_internal/compiler.py similarity index 100% rename from guppylang/prelude/_internal/compiler.py rename to guppylang/std/_internal/compiler.py diff --git a/guppylang/prelude/_internal/compiler/__init__.py b/guppylang/std/_internal/compiler/__init__.py similarity index 100% rename from guppylang/prelude/_internal/compiler/__init__.py rename to guppylang/std/_internal/compiler/__init__.py diff --git a/guppylang/prelude/_internal/compiler/arithmetic.py b/guppylang/std/_internal/compiler/arithmetic.py similarity index 96% rename from guppylang/prelude/_internal/compiler/arithmetic.py rename to guppylang/std/_internal/compiler/arithmetic.py index bea97af6..f1202e97 100644 --- a/guppylang/prelude/_internal/compiler/arithmetic.py +++ b/guppylang/std/_internal/compiler/arithmetic.py @@ -103,7 +103,7 @@ class NatTruedivCompiler(CustomCallCompiler): """Compiler for the `nat.__truediv__` method.""" def compile(self, args: list[Wire]) -> list[Wire]: - from guppylang.prelude.builtins import Float, Nat + from guppylang.std.builtins import Float, Nat # Compile `truediv` using float arithmetic [left, right] = args @@ -138,7 +138,7 @@ class IntTruedivCompiler(CustomCallCompiler): """Compiler for the `int.__truediv__` method.""" def compile(self, args: list[Wire]) -> list[Wire]: - from guppylang.prelude.builtins import Float, Int + from guppylang.std.builtins import Float, Int # Compile `truediv` using float arithmetic [left, right] = args @@ -173,7 +173,7 @@ class FloatBoolCompiler(CustomCallCompiler): """Compiler for the `float.__bool__` method.""" def compile(self, args: list[Wire]) -> list[Wire]: - from guppylang.prelude.builtins import Float + from guppylang.std.builtins import Float # We have: bool(x) = (x != 0.0) zero = self.builder.load(hugr.std.float.FloatVal(0.0)) @@ -192,7 +192,7 @@ class FloatFloordivCompiler(CustomCallCompiler): """Compiler for the `float.__floordiv__` method.""" def compile(self, args: list[Wire]) -> list[Wire]: - from guppylang.prelude.builtins import Float + from guppylang.std.builtins import Float # We have: floordiv(x, y) = floor(truediv(x, y)) [div] = Float.__truediv__.compile_call( @@ -218,7 +218,7 @@ class FloatModCompiler(CustomCallCompiler): """Compiler for the `float.__mod__` method.""" def compile(self, args: list[Wire]) -> list[Wire]: - from guppylang.prelude.builtins import Float + from guppylang.std.builtins import Float # We have: mod(x, y) = x - (x // y) * y [div] = Float.__floordiv__.compile_call( @@ -252,7 +252,7 @@ class FloatDivmodCompiler(CustomCallCompiler): """Compiler for the `__divmod__` method.""" def compile(self, args: list[Wire]) -> list[Wire]: - from guppylang.prelude.builtins import Float + from guppylang.std.builtins import Float # We have: divmod(x, y) = (div(x, y), mod(x, y)) [div] = Float.__truediv__.compile_call( diff --git a/guppylang/prelude/_internal/compiler/array.py b/guppylang/std/_internal/compiler/array.py similarity index 98% rename from guppylang/prelude/_internal/compiler/array.py rename to guppylang/std/_internal/compiler/array.py index 5c571d4e..b17b8243 100644 --- a/guppylang/prelude/_internal/compiler/array.py +++ b/guppylang/std/_internal/compiler/array.py @@ -9,8 +9,8 @@ from guppylang.definition.custom import CustomCallCompiler from guppylang.definition.value import CallReturnWires from guppylang.error import InternalGuppyError -from guppylang.prelude._internal.compiler.arithmetic import convert_itousize -from guppylang.prelude._internal.compiler.prelude import ( +from guppylang.std._internal.compiler.arithmetic import convert_itousize +from guppylang.std._internal.compiler.prelude import ( build_unwrap, build_unwrap_left, build_unwrap_right, diff --git a/guppylang/prelude/_internal/compiler/list.py b/guppylang/std/_internal/compiler/list.py similarity index 99% rename from guppylang/prelude/_internal/compiler/list.py rename to guppylang/std/_internal/compiler/list.py index 72872d67..2e7019a1 100644 --- a/guppylang/prelude/_internal/compiler/list.py +++ b/guppylang/std/_internal/compiler/list.py @@ -14,11 +14,11 @@ from guppylang.definition.custom import CustomCallCompiler from guppylang.definition.value import CallReturnWires from guppylang.error import InternalGuppyError -from guppylang.prelude._internal.compiler.arithmetic import ( +from guppylang.std._internal.compiler.arithmetic import ( convert_ifromusize, convert_itousize, ) -from guppylang.prelude._internal.compiler.prelude import ( +from guppylang.std._internal.compiler.prelude import ( build_unwrap, build_unwrap_left, build_unwrap_right, diff --git a/guppylang/prelude/_internal/compiler/prelude.py b/guppylang/std/_internal/compiler/prelude.py similarity index 100% rename from guppylang/prelude/_internal/compiler/prelude.py rename to guppylang/std/_internal/compiler/prelude.py diff --git a/guppylang/prelude/_internal/compiler/quantum.py b/guppylang/std/_internal/compiler/quantum.py similarity index 95% rename from guppylang/prelude/_internal/compiler/quantum.py rename to guppylang/std/_internal/compiler/quantum.py index 5d11cb1f..149798af 100644 --- a/guppylang/prelude/_internal/compiler/quantum.py +++ b/guppylang/std/_internal/compiler/quantum.py @@ -50,7 +50,7 @@ class MeasureReturnCompiler(CustomInoutCallCompiler): """Compiler for the `measure_return` function.""" def compile_with_inouts(self, args: list[Wire]) -> CallReturnWires: - from guppylang.prelude._internal.util import quantum_op + from guppylang.std._internal.util import quantum_op [q] = args [q, bit] = self.builder.add_op( @@ -67,7 +67,7 @@ def __init__(self, opname: str): self.opname = opname def compile_with_inouts(self, args: list[Wire]) -> CallReturnWires: - from guppylang.prelude._internal.util import quantum_op + from guppylang.std._internal.util import quantum_op [*qs, angle] = args [halfturns] = self.builder.add_op(ops.UnpackTuple([FLOAT_T]), angle) diff --git a/guppylang/prelude/_internal/util.py b/guppylang/std/_internal/util.py similarity index 98% rename from guppylang/prelude/_internal/util.py rename to guppylang/std/_internal/util.py index 3a307a7c..ac1d76b4 100644 --- a/guppylang/prelude/_internal/util.py +++ b/guppylang/std/_internal/util.py @@ -16,7 +16,7 @@ from hugr import tys as ht from guppylang.compiler.hugr_extension import UnsupportedOp -from guppylang.prelude._internal.compiler.quantum import QUANTUM_EXTENSION +from guppylang.std._internal.compiler.quantum import QUANTUM_EXTENSION from guppylang.tys.subst import Inst from guppylang.tys.ty import NumericType diff --git a/guppylang/prelude/angles.py b/guppylang/std/angles.py similarity index 97% rename from guppylang/prelude/angles.py rename to guppylang/std/angles.py index 21adf7eb..cebdfd9f 100644 --- a/guppylang/prelude/angles.py +++ b/guppylang/std/angles.py @@ -10,7 +10,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import py +from guppylang.std.builtins import py angles = GuppyModule("angles") diff --git a/guppylang/prelude/builtins.py b/guppylang/std/builtins.py similarity index 98% rename from guppylang/prelude/builtins.py rename to guppylang/std/builtins.py index 57130818..250a04e2 100644 --- a/guppylang/prelude/builtins.py +++ b/guppylang/std/builtins.py @@ -8,7 +8,7 @@ from guppylang.decorator import guppy from guppylang.definition.custom import DefaultCallChecker, NoopCompiler -from guppylang.prelude._internal.checker import ( +from guppylang.std._internal.checker import ( ArrayLenChecker, CallableChecker, CoercingChecker, @@ -19,7 +19,7 @@ ReversingChecker, UnsupportedChecker, ) -from guppylang.prelude._internal.compiler.arithmetic import ( +from guppylang.std._internal.compiler.arithmetic import ( FloatBoolCompiler, FloatDivmodCompiler, FloatFloordivCompiler, @@ -29,19 +29,19 @@ IToBoolCompiler, NatTruedivCompiler, ) -from guppylang.prelude._internal.compiler.array import ( +from guppylang.std._internal.compiler.array import ( ArrayGetitemCompiler, ArraySetitemCompiler, NewArrayCompiler, ) -from guppylang.prelude._internal.compiler.list import ( +from guppylang.std._internal.compiler.list import ( ListGetitemCompiler, ListLengthCompiler, ListPopCompiler, ListPushCompiler, ListSetitemCompiler, ) -from guppylang.prelude._internal.util import ( +from guppylang.std._internal.util import ( float_op, int_op, logic_op, diff --git a/guppylang/prelude/quantum.py b/guppylang/std/quantum.py similarity index 95% rename from guppylang/prelude/quantum.py rename to guppylang/std/quantum.py index 7c54e6b8..aa1ab8d7 100644 --- a/guppylang/prelude/quantum.py +++ b/guppylang/std/quantum.py @@ -7,14 +7,14 @@ from hugr import tys as ht from guppylang.decorator import guppy -from guppylang.prelude._internal.compiler.quantum import ( +from guppylang.std._internal.compiler.quantum import ( HSERIES_EXTENSION, MeasureReturnCompiler, RotationCompiler, ) -from guppylang.prelude._internal.util import quantum_op -from guppylang.prelude.angles import angle -from guppylang.prelude.builtins import owned +from guppylang.std._internal.util import quantum_op +from guppylang.std.angles import angle +from guppylang.std.builtins import owned @guppy.type(ht.Qubit, linear=True) diff --git a/guppylang/prelude/quantum_functional.py b/guppylang/std/quantum_functional.py similarity index 93% rename from guppylang/prelude/quantum_functional.py rename to guppylang/std/quantum_functional.py index 96aea683..408e9da7 100644 --- a/guppylang/prelude/quantum_functional.py +++ b/guppylang/std/quantum_functional.py @@ -2,15 +2,15 @@ from typing import no_type_check -import guppylang.prelude.angles as angles -import guppylang.prelude.quantum as quantum +import guppylang.std.angles as angles +import guppylang.std.quantum as quantum from guppylang.decorator import guppy # mypy: disable-error-code="empty-body, misc, valid-type" from guppylang.module import GuppyModule -from guppylang.prelude.angles import angle -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.angles import angle +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit quantum_functional = GuppyModule("quantum_functional") diff --git a/tests/error/array_errors/new_array_cannot_infer.py b/tests/error/array_errors/new_array_cannot_infer.py index e6e92f15..56761fad 100644 --- a/tests/error/array_errors/new_array_cannot_infer.py +++ b/tests/error/array_errors/new_array_cannot_infer.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/error/array_errors/new_array_check_fail.py b/tests/error/array_errors/new_array_check_fail.py index cd179a4d..a12f33d6 100644 --- a/tests/error/array_errors/new_array_check_fail.py +++ b/tests/error/array_errors/new_array_check_fail.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/error/array_errors/new_array_elem_mismatch1.py b/tests/error/array_errors/new_array_elem_mismatch1.py index 89c0653f..74aebaf8 100644 --- a/tests/error/array_errors/new_array_elem_mismatch1.py +++ b/tests/error/array_errors/new_array_elem_mismatch1.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/error/array_errors/new_array_elem_mismatch2.py b/tests/error/array_errors/new_array_elem_mismatch2.py index 3dba7541..be58931d 100644 --- a/tests/error/array_errors/new_array_elem_mismatch2.py +++ b/tests/error/array_errors/new_array_elem_mismatch2.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/error/array_errors/new_array_wrong_length.py b/tests/error/array_errors/new_array_wrong_length.py index e3dc51db..2af4a79c 100644 --- a/tests/error/array_errors/new_array_wrong_length.py +++ b/tests/error/array_errors/new_array_wrong_length.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/error/array_errors/subscript_after_use.py b/tests/error/array_errors/subscript_after_use.py index e952ad81..7944a81e 100644 --- a/tests/error/array_errors/subscript_after_use.py +++ b/tests/error/array_errors/subscript_after_use.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array, owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import array, owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/array_errors/subscript_drop.py b/tests/error/array_errors/subscript_drop.py index 8775a1d4..93c0cc9f 100644 --- a/tests/error/array_errors/subscript_drop.py +++ b/tests/error/array_errors/subscript_drop.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import array +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/array_errors/subscript_non_inout.py b/tests/error/array_errors/subscript_non_inout.py index 0455bcfb..37606c7e 100644 --- a/tests/error/array_errors/subscript_non_inout.py +++ b/tests/error/array_errors/subscript_non_inout.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import array +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/array_errors/use_after_subscript.py b/tests/error/array_errors/use_after_subscript.py index 9f754c16..33bbc992 100644 --- a/tests/error/array_errors/use_after_subscript.py +++ b/tests/error/array_errors/use_after_subscript.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array, owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import array, owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/comprehension_errors/capture1.py b/tests/error/comprehension_errors/capture1.py index d0981bec..e8fae285 100644 --- a/tests/error/comprehension_errors/capture1.py +++ b/tests/error/comprehension_errors/capture1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/capture2.py b/tests/error/comprehension_errors/capture2.py index 4139bb35..bccf752a 100644 --- a/tests/error/comprehension_errors/capture2.py +++ b/tests/error/comprehension_errors/capture2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/capture3.py b/tests/error/comprehension_errors/capture3.py index f1b137c5..15023bbd 100644 --- a/tests/error/comprehension_errors/capture3.py +++ b/tests/error/comprehension_errors/capture3.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/capture4.py b/tests/error/comprehension_errors/capture4.py index 6147b4bb..6261f9bc 100644 --- a/tests/error/comprehension_errors/capture4.py +++ b/tests/error/comprehension_errors/capture4.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/guarded1.py b/tests/error/comprehension_errors/guarded1.py index 527d4a41..e252f32c 100644 --- a/tests/error/comprehension_errors/guarded1.py +++ b/tests/error/comprehension_errors/guarded1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/guarded2.py b/tests/error/comprehension_errors/guarded2.py index aa8832a4..55e4c49c 100644 --- a/tests/error/comprehension_errors/guarded2.py +++ b/tests/error/comprehension_errors/guarded2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/guarded3.py b/tests/error/comprehension_errors/guarded3.py index 3c9c5824..eeb936af 100644 --- a/tests/error/comprehension_errors/guarded3.py +++ b/tests/error/comprehension_errors/guarded3.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/multi_use1.py b/tests/error/comprehension_errors/multi_use1.py index c2a44a6f..dd2c53fb 100644 --- a/tests/error/comprehension_errors/multi_use1.py +++ b/tests/error/comprehension_errors/multi_use1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/multi_use2.py b/tests/error/comprehension_errors/multi_use2.py index c99e2538..c1b673f2 100644 --- a/tests/error/comprehension_errors/multi_use2.py +++ b/tests/error/comprehension_errors/multi_use2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/multi_use3.py b/tests/error/comprehension_errors/multi_use3.py index 2bbdb763..6bc0ad18 100644 --- a/tests/error/comprehension_errors/multi_use3.py +++ b/tests/error/comprehension_errors/multi_use3.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/not_used1.py b/tests/error/comprehension_errors/not_used1.py index 45d772ec..485541f8 100644 --- a/tests/error/comprehension_errors/not_used1.py +++ b/tests/error/comprehension_errors/not_used1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/not_used2.py b/tests/error/comprehension_errors/not_used2.py index f08aec63..e01b98ca 100644 --- a/tests/error/comprehension_errors/not_used2.py +++ b/tests/error/comprehension_errors/not_used2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/pattern_override1.py b/tests/error/comprehension_errors/pattern_override1.py index 33f850b2..8940803d 100644 --- a/tests/error/comprehension_errors/pattern_override1.py +++ b/tests/error/comprehension_errors/pattern_override1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/pattern_override2.py b/tests/error/comprehension_errors/pattern_override2.py index eb56269b..da0797d4 100644 --- a/tests/error/comprehension_errors/pattern_override2.py +++ b/tests/error/comprehension_errors/pattern_override2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/used_twice1.py b/tests/error/comprehension_errors/used_twice1.py index af4eb8ea..473e4303 100644 --- a/tests/error/comprehension_errors/used_twice1.py +++ b/tests/error/comprehension_errors/used_twice1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/used_twice2.py b/tests/error/comprehension_errors/used_twice2.py index d563686d..56aa52ef 100644 --- a/tests/error/comprehension_errors/used_twice2.py +++ b/tests/error/comprehension_errors/used_twice2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/comprehension_errors/used_twice3.py b/tests/error/comprehension_errors/used_twice3.py index a10352d4..e945271c 100644 --- a/tests/error/comprehension_errors/used_twice3.py +++ b/tests/error/comprehension_errors/used_twice3.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/inout_errors/already_used.py b/tests/error/inout_errors/already_used.py index 08d24357..77ab6ee6 100644 --- a/tests/error/inout_errors/already_used.py +++ b/tests/error/inout_errors/already_used.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/conflict.py b/tests/error/inout_errors/conflict.py index eb8b9517..08560917 100644 --- a/tests/error/inout_errors/conflict.py +++ b/tests/error/inout_errors/conflict.py @@ -2,8 +2,8 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/inout_errors/drop_after_call.py b/tests/error/inout_errors/drop_after_call.py index 38ab7e08..28611983 100644 --- a/tests/error/inout_errors/drop_after_call.py +++ b/tests/error/inout_errors/drop_after_call.py @@ -1,6 +1,6 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/moved.py b/tests/error/inout_errors/moved.py index ecbafaec..48d3beed 100644 --- a/tests/error/inout_errors/moved.py +++ b/tests/error/inout_errors/moved.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/moved_assign.py b/tests/error/inout_errors/moved_assign.py index a26f2548..18b806df 100644 --- a/tests/error/inout_errors/moved_assign.py +++ b/tests/error/inout_errors/moved_assign.py @@ -1,6 +1,6 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/moved_if.py b/tests/error/inout_errors/moved_if.py index b4a284cd..74ad7298 100644 --- a/tests/error/inout_errors/moved_if.py +++ b/tests/error/inout_errors/moved_if.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/moved_out.py b/tests/error/inout_errors/moved_out.py index eb3d9361..dc8db1f0 100644 --- a/tests/error/inout_errors/moved_out.py +++ b/tests/error/inout_errors/moved_out.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/moved_out_if.py b/tests/error/inout_errors/moved_out_if.py index 951fc35a..d89dc25c 100644 --- a/tests/error/inout_errors/moved_out_if.py +++ b/tests/error/inout_errors/moved_out_if.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/nested_call_right_to_left.py b/tests/error/inout_errors/nested_call_right_to_left.py index d82f787f..e2802817 100644 --- a/tests/error/inout_errors/nested_call_right_to_left.py +++ b/tests/error/inout_errors/nested_call_right_to_left.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/nonlinear.py b/tests/error/inout_errors/nonlinear.py index f69f6103..95eb9809 100644 --- a/tests/error/inout_errors/nonlinear.py +++ b/tests/error/inout_errors/nonlinear.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/inout_errors/nonlinear_callable.py b/tests/error/inout_errors/nonlinear_callable.py index f403efe4..215ee6a1 100644 --- a/tests/error/inout_errors/nonlinear_callable.py +++ b/tests/error/inout_errors/nonlinear_callable.py @@ -2,7 +2,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned +from guppylang.std.builtins import owned module = GuppyModule("test") diff --git a/tests/error/inout_errors/override_after_call.py b/tests/error/inout_errors/override_after_call.py index 18bdcf5c..1b38d121 100644 --- a/tests/error/inout_errors/override_after_call.py +++ b/tests/error/inout_errors/override_after_call.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/shadow.py b/tests/error/inout_errors/shadow.py index caee9b1b..82fe2dba 100644 --- a/tests/error/inout_errors/shadow.py +++ b/tests/error/inout_errors/shadow.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/shadow_if.py b/tests/error/inout_errors/shadow_if.py index b8be43b2..04ca7ed7 100644 --- a/tests/error/inout_errors/shadow_if.py +++ b/tests/error/inout_errors/shadow_if.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/struct_constructor.py b/tests/error/inout_errors/struct_constructor.py index dc8432a2..bee3ff70 100644 --- a/tests/error/inout_errors/struct_constructor.py +++ b/tests/error/inout_errors/struct_constructor.py @@ -1,6 +1,6 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/subscript_not_setable.py b/tests/error/inout_errors/subscript_not_setable.py index 7b630397..5f8385f7 100644 --- a/tests/error/inout_errors/subscript_not_setable.py +++ b/tests/error/inout_errors/subscript_not_setable.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/inout_errors/unused_after_call.py b/tests/error/inout_errors/unused_after_call.py index 9989f16b..fcc5bfeb 100644 --- a/tests/error/inout_errors/unused_after_call.py +++ b/tests/error/inout_errors/unused_after_call.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/linear_errors/branch_use.py b/tests/error/linear_errors/branch_use.py index 4db333ec..63e0fa60 100644 --- a/tests/error/linear_errors/branch_use.py +++ b/tests/error/linear_errors/branch_use.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/branch_use_field1.py b/tests/error/linear_errors/branch_use_field1.py index 68c886a3..3b60ba34 100644 --- a/tests/error/linear_errors/branch_use_field1.py +++ b/tests/error/linear_errors/branch_use_field1.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.quantum import qubit, measure module = GuppyModule("test") diff --git a/tests/error/linear_errors/branch_use_field2.py b/tests/error/linear_errors/branch_use_field2.py index e86cd109..c96a1720 100644 --- a/tests/error/linear_errors/branch_use_field2.py +++ b/tests/error/linear_errors/branch_use_field2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit, measure module = GuppyModule("test") diff --git a/tests/error/linear_errors/break_unused.py b/tests/error/linear_errors/break_unused.py index 4ba66fc1..55afe144 100644 --- a/tests/error/linear_errors/break_unused.py +++ b/tests/error/linear_errors/break_unused.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/call_drop_field.py b/tests/error/linear_errors/call_drop_field.py index baae2ede..5cc482d5 100644 --- a/tests/error/linear_errors/call_drop_field.py +++ b/tests/error/linear_errors/call_drop_field.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/continue_unused.py b/tests/error/linear_errors/continue_unused.py index 718bf588..8660e1e3 100644 --- a/tests/error/linear_errors/continue_unused.py +++ b/tests/error/linear_errors/continue_unused.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/copy_qubit.py b/tests/error/linear_errors/copy_qubit.py index bde9bcc3..562fd03e 100644 --- a/tests/error/linear_errors/copy_qubit.py +++ b/tests/error/linear_errors/copy_qubit.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/field_copy1.py b/tests/error/linear_errors/field_copy1.py index 913a2976..3ef7abd5 100644 --- a/tests/error/linear_errors/field_copy1.py +++ b/tests/error/linear_errors/field_copy1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/field_copy2.py b/tests/error/linear_errors/field_copy2.py index 58a5e28e..9ea0267b 100644 --- a/tests/error/linear_errors/field_copy2.py +++ b/tests/error/linear_errors/field_copy2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/field_copy3.py b/tests/error/linear_errors/field_copy3.py index 7490b338..37c060c7 100644 --- a/tests/error/linear_errors/field_copy3.py +++ b/tests/error/linear_errors/field_copy3.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/field_copy_nested1.py b/tests/error/linear_errors/field_copy_nested1.py index f08391de..21975a91 100644 --- a/tests/error/linear_errors/field_copy_nested1.py +++ b/tests/error/linear_errors/field_copy_nested1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit, measure module = GuppyModule("test") diff --git a/tests/error/linear_errors/field_copy_nested2.py b/tests/error/linear_errors/field_copy_nested2.py index d4788bf2..861787b2 100644 --- a/tests/error/linear_errors/field_copy_nested2.py +++ b/tests/error/linear_errors/field_copy_nested2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit, measure module = GuppyModule("test") diff --git a/tests/error/linear_errors/field_copy_nested3.py b/tests/error/linear_errors/field_copy_nested3.py index 6f2670b6..b1a85bfc 100644 --- a/tests/error/linear_errors/field_copy_nested3.py +++ b/tests/error/linear_errors/field_copy_nested3.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit, measure module = GuppyModule("test") diff --git a/tests/error/linear_errors/field_copy_nested4.py b/tests/error/linear_errors/field_copy_nested4.py index ad39e4a6..f0c369c9 100644 --- a/tests/error/linear_errors/field_copy_nested4.py +++ b/tests/error/linear_errors/field_copy_nested4.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit, measure module = GuppyModule("test") diff --git a/tests/error/linear_errors/for_break.py b/tests/error/linear_errors/for_break.py index 6f8b5024..0e6a5b6e 100644 --- a/tests/error/linear_errors/for_break.py +++ b/tests/error/linear_errors/for_break.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/linear_errors/for_return.py b/tests/error/linear_errors/for_return.py index d01fd782..8f7881b1 100644 --- a/tests/error/linear_errors/for_return.py +++ b/tests/error/linear_errors/for_return.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.builtins import owned module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/linear_errors/if_both_unused.py b/tests/error/linear_errors/if_both_unused.py index 1df37c04..8b6716e0 100644 --- a/tests/error/linear_errors/if_both_unused.py +++ b/tests/error/linear_errors/if_both_unused.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/if_both_unused_field.py b/tests/error/linear_errors/if_both_unused_field.py index deab7d08..52a2cd2a 100644 --- a/tests/error/linear_errors/if_both_unused_field.py +++ b/tests/error/linear_errors/if_both_unused_field.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/if_both_unused_reassign.py b/tests/error/linear_errors/if_both_unused_reassign.py index 03f76713..318f8700 100644 --- a/tests/error/linear_errors/if_both_unused_reassign.py +++ b/tests/error/linear_errors/if_both_unused_reassign.py @@ -1,7 +1,7 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/if_both_unused_reassign_field.py b/tests/error/linear_errors/if_both_unused_reassign_field.py index 3eca48d5..f7642c8a 100644 --- a/tests/error/linear_errors/if_both_unused_reassign_field.py +++ b/tests/error/linear_errors/if_both_unused_reassign_field.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/method_capture.py b/tests/error/linear_errors/method_capture.py index 520984b8..caf0b40e 100644 --- a/tests/error/linear_errors/method_capture.py +++ b/tests/error/linear_errors/method_capture.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/reassign_unused.py b/tests/error/linear_errors/reassign_unused.py index 82923a29..1ce0652b 100644 --- a/tests/error/linear_errors/reassign_unused.py +++ b/tests/error/linear_errors/reassign_unused.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/reassign_unused_field.py b/tests/error/linear_errors/reassign_unused_field.py index 08f78cb6..ce1fa0a5 100644 --- a/tests/error/linear_errors/reassign_unused_field.py +++ b/tests/error/linear_errors/reassign_unused_field.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/reassign_unused_tuple.py b/tests/error/linear_errors/reassign_unused_tuple.py index 802c1a91..867ad7c0 100644 --- a/tests/error/linear_errors/reassign_unused_tuple.py +++ b/tests/error/linear_errors/reassign_unused_tuple.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused.py b/tests/error/linear_errors/unused.py index 9486367d..38d554a3 100644 --- a/tests/error/linear_errors/unused.py +++ b/tests/error/linear_errors/unused.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused_expr.py b/tests/error/linear_errors/unused_expr.py index 6f90a930..d95adbd3 100644 --- a/tests/error/linear_errors/unused_expr.py +++ b/tests/error/linear_errors/unused_expr.py @@ -1,8 +1,8 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit -from guppylang.prelude.quantum_functional import h +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.quantum_functional import h module = GuppyModule("test") module.load(qubit, h) diff --git a/tests/error/linear_errors/unused_field1.py b/tests/error/linear_errors/unused_field1.py index fd7c44dc..d667f123 100644 --- a/tests/error/linear_errors/unused_field1.py +++ b/tests/error/linear_errors/unused_field1.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused_field2.py b/tests/error/linear_errors/unused_field2.py index 9e63928b..c9cb077d 100644 --- a/tests/error/linear_errors/unused_field2.py +++ b/tests/error/linear_errors/unused_field2.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused_field3.py b/tests/error/linear_errors/unused_field3.py index ca637c09..2f0b30d3 100644 --- a/tests/error/linear_errors/unused_field3.py +++ b/tests/error/linear_errors/unused_field3.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit, measure module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused_same_block.py b/tests/error/linear_errors/unused_same_block.py index ea45f701..6b80ad44 100644 --- a/tests/error/linear_errors/unused_same_block.py +++ b/tests/error/linear_errors/unused_same_block.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/while_unused.py b/tests/error/linear_errors/while_unused.py index 1fd83834..1fb61cd0 100644 --- a/tests/error/linear_errors/while_unused.py +++ b/tests/error/linear_errors/while_unused.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit -from guppylang.prelude.quantum_functional import h +from guppylang.std.quantum import qubit +from guppylang.std.quantum_functional import h module = GuppyModule("test") module.load(qubit, h) diff --git a/tests/error/misc_errors/extern_bad_type.py b/tests/error/misc_errors/extern_bad_type.py index adf4e5c2..2b331e1b 100644 --- a/tests/error/misc_errors/extern_bad_type.py +++ b/tests/error/misc_errors/extern_bad_type.py @@ -1,8 +1,8 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum module = GuppyModule("test") diff --git a/tests/error/misc_errors/invalid_arg_flag.py b/tests/error/misc_errors/invalid_arg_flag.py index 4d8e4be1..912ffe53 100644 --- a/tests/error/misc_errors/invalid_arg_flag.py +++ b/tests/error/misc_errors/invalid_arg_flag.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/misc_errors/negative_nat_arg.py b/tests/error/misc_errors/negative_nat_arg.py index 4b20d072..be9476f9 100644 --- a/tests/error/misc_errors/negative_nat_arg.py +++ b/tests/error/misc_errors/negative_nat_arg.py @@ -1,4 +1,4 @@ -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array from tests.util import compile_guppy diff --git a/tests/error/misc_errors/nested_arg_flag.py b/tests/error/misc_errors/nested_arg_flag.py index f2af08c3..a76f5b0a 100644 --- a/tests/error/misc_errors/nested_arg_flag.py +++ b/tests/error/misc_errors/nested_arg_flag.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/misc_errors/result_array_not_numeric.py b/tests/error/misc_errors/result_array_not_numeric.py index f8129ec9..0649a536 100644 --- a/tests/error/misc_errors/result_array_not_numeric.py +++ b/tests/error/misc_errors/result_array_not_numeric.py @@ -1,4 +1,4 @@ -from guppylang.prelude.builtins import result, array +from guppylang.std.builtins import result, array from tests.util import compile_guppy diff --git a/tests/error/misc_errors/result_tag_not_static.py b/tests/error/misc_errors/result_tag_not_static.py index 100b1752..77cf2ab0 100644 --- a/tests/error/misc_errors/result_tag_not_static.py +++ b/tests/error/misc_errors/result_tag_not_static.py @@ -1,4 +1,4 @@ -from guppylang.prelude.builtins import result +from guppylang.std.builtins import result from tests.util import compile_guppy diff --git a/tests/error/misc_errors/result_tag_not_str.py b/tests/error/misc_errors/result_tag_not_str.py index 92652eb4..3efb0818 100644 --- a/tests/error/misc_errors/result_tag_not_str.py +++ b/tests/error/misc_errors/result_tag_not_str.py @@ -1,4 +1,4 @@ -from guppylang.prelude.builtins import result +from guppylang.std.builtins import result from tests.util import compile_guppy diff --git a/tests/error/misc_errors/result_tag_too_big.py b/tests/error/misc_errors/result_tag_too_big.py index 105b5bba..807b9009 100644 --- a/tests/error/misc_errors/result_tag_too_big.py +++ b/tests/error/misc_errors/result_tag_too_big.py @@ -1,4 +1,4 @@ -from guppylang.prelude.builtins import result, py +from guppylang.std.builtins import result, py from tests.util import compile_guppy # TODO use this once https://github.com/CQCL/guppylang/issues/599 lands diff --git a/tests/error/misc_errors/result_value_linear.py b/tests/error/misc_errors/result_value_linear.py index 6a3d3f26..efc390c6 100644 --- a/tests/error/misc_errors/result_value_linear.py +++ b/tests/error/misc_errors/result_value_linear.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import result -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import result +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/misc_errors/return_flag.py b/tests/error/misc_errors/return_flag.py index 78b576fe..497901d3 100644 --- a/tests/error/misc_errors/return_flag.py +++ b/tests/error/misc_errors/return_flag.py @@ -1,7 +1,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/misc_errors/return_flag_callable.py b/tests/error/misc_errors/return_flag_callable.py index 79061edb..8d0a2132 100644 --- a/tests/error/misc_errors/return_flag_callable.py +++ b/tests/error/misc_errors/return_flag_callable.py @@ -2,8 +2,8 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/nested_errors/linear_capture.py b/tests/error/nested_errors/linear_capture.py index 9f546982..67710bb3 100644 --- a/tests/error/nested_errors/linear_capture.py +++ b/tests/error/nested_errors/linear_capture.py @@ -1,8 +1,8 @@ -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit module = GuppyModule("test") diff --git a/tests/error/poly_errors/arg_mismatch3.py b/tests/error/poly_errors/arg_mismatch3.py index 515bee0f..4f52d6a4 100644 --- a/tests/error/poly_errors/arg_mismatch3.py +++ b/tests/error/poly_errors/arg_mismatch3.py @@ -1,6 +1,6 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/error/poly_errors/arg_mismatch4.py b/tests/error/poly_errors/arg_mismatch4.py index 9ffdf91c..d7e528e3 100644 --- a/tests/error/poly_errors/arg_mismatch4.py +++ b/tests/error/poly_errors/arg_mismatch4.py @@ -1,6 +1,6 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/error/poly_errors/non_linear1.py b/tests/error/poly_errors/non_linear1.py index 2f298bfc..a9866edd 100644 --- a/tests/error/poly_errors/non_linear1.py +++ b/tests/error/poly_errors/non_linear1.py @@ -1,8 +1,8 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/poly_errors/non_linear2.py b/tests/error/poly_errors/non_linear2.py index 710b3279..2066b0a9 100644 --- a/tests/error/poly_errors/non_linear2.py +++ b/tests/error/poly_errors/non_linear2.py @@ -2,9 +2,9 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum_functional import h +from guppylang.std.quantum_functional import h -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum module = GuppyModule("test") module.load_all(quantum) diff --git a/tests/error/poly_errors/non_linear3.py b/tests/error/poly_errors/non_linear3.py index c732c2f4..bd57d225 100644 --- a/tests/error/poly_errors/non_linear3.py +++ b/tests/error/poly_errors/non_linear3.py @@ -3,7 +3,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/py_errors/invalid_type_arg.py b/tests/error/py_errors/invalid_type_arg.py index d6993d4d..6dcc8214 100644 --- a/tests/error/py_errors/invalid_type_arg.py +++ b/tests/error/py_errors/invalid_type_arg.py @@ -1,5 +1,5 @@ from guppylang import py -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array from tests.util import compile_guppy diff --git a/tests/error/py_errors/tket2_not_installed.py b/tests/error/py_errors/tket2_not_installed.py index 8b619b71..5eafcf1e 100644 --- a/tests/error/py_errors/tket2_not_installed.py +++ b/tests/error/py_errors/tket2_not_installed.py @@ -2,7 +2,7 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit circ = Circuit(1) circ.H(0) diff --git a/tests/error/struct_errors/mutate_classical.py b/tests/error/struct_errors/mutate_classical.py index 6becfeaa..eb8f1bb4 100644 --- a/tests/error/struct_errors/mutate_classical.py +++ b/tests/error/struct_errors/mutate_classical.py @@ -1,6 +1,6 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit module = GuppyModule("test") module.load(qubit) diff --git a/tests/error/type_errors/subscript_bad_item.py b/tests/error/type_errors/subscript_bad_item.py index ee4e0a6e..d14a0171 100644 --- a/tests/error/type_errors/subscript_bad_item.py +++ b/tests/error/type_errors/subscript_bad_item.py @@ -1,6 +1,6 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array +from guppylang.std.builtins import array module = GuppyModule("test") diff --git a/tests/integration/modules/mod_b.py b/tests/integration/modules/mod_b.py index 2e8e114d..2409e24c 100644 --- a/tests/integration/modules/mod_b.py +++ b/tests/integration/modules/mod_b.py @@ -1,7 +1,7 @@ """Dummy module used in `test_imports.py`""" from guppylang import GuppyModule, guppy -from guppylang.prelude._internal.util import unsupported_op +from guppylang.std._internal.util import unsupported_op mod_b = GuppyModule("mod_b") diff --git a/tests/integration/test_arithmetic.py b/tests/integration/test_arithmetic.py index 0fe46045..4a10312a 100644 --- a/tests/integration/test_arithmetic.py +++ b/tests/integration/test_arithmetic.py @@ -1,7 +1,7 @@ import pytest from guppylang.decorator import guppy -from guppylang.prelude.angles import angle, pi, angles -from guppylang.prelude.builtins import nat +from guppylang.std.angles import angle, pi, angles +from guppylang.std.builtins import nat from guppylang.module import GuppyModule from tests.util import compile_guppy diff --git a/tests/integration/test_array.py b/tests/integration/test_array.py index d71f5b2a..f98bc33e 100644 --- a/tests/integration/test_array.py +++ b/tests/integration/test_array.py @@ -3,11 +3,11 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array, owned +from guppylang.std.builtins import array, owned from tests.util import compile_guppy -from guppylang.prelude.quantum import qubit -import guppylang.prelude.quantum as quantum +from guppylang.std.quantum import qubit +import guppylang.std.quantum as quantum def test_len(validate): diff --git a/tests/integration/test_comprehension.py b/tests/integration/test_comprehension.py index efab868b..22967d74 100644 --- a/tests/integration/test_comprehension.py +++ b/tests/integration/test_comprehension.py @@ -2,11 +2,11 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit -from guppylang.prelude.quantum_functional import h, cx +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit +from guppylang.std.quantum_functional import h, cx -import guppylang.prelude.quantum_functional as quantum +import guppylang.std.quantum_functional as quantum from guppylang.tys.ty import NoneType from tests.util import compile_guppy diff --git a/tests/integration/test_inout.py b/tests/integration/test_inout.py index 25292de0..347936a3 100644 --- a/tests/integration/test_inout.py +++ b/tests/integration/test_inout.py @@ -3,10 +3,10 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum def test_basic(validate): diff --git a/tests/integration/test_linear.py b/tests/integration/test_linear.py index e42a9161..918e90d9 100644 --- a/tests/integration/test_linear.py +++ b/tests/integration/test_linear.py @@ -1,10 +1,10 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import qubit, measure +from guppylang.std.builtins import owned +from guppylang.std.quantum import qubit, measure -import guppylang.prelude.quantum_functional as quantum_functional -from guppylang.prelude.quantum_functional import cx, t, h, measure_return +import guppylang.std.quantum_functional as quantum_functional +from guppylang.std.quantum_functional import cx, t, h, measure_return from guppylang.tys.ty import NoneType import pytest diff --git a/tests/integration/test_list.py b/tests/integration/test_list.py index d32f34b9..88c72567 100644 --- a/tests/integration/test_list.py +++ b/tests/integration/test_list.py @@ -1,10 +1,10 @@ import pytest from guppylang import qubit, guppy, GuppyModule -from guppylang.prelude import quantum -from guppylang.prelude.angles import angle -from guppylang.prelude.builtins import owned -from guppylang.prelude.quantum import cx, rz -from guppylang.prelude.quantum_functional import quantum_functional, h +from guppylang.std import quantum +from guppylang.std.angles import angle +from guppylang.std.builtins import owned +from guppylang.std.quantum import cx, rz +from guppylang.std.quantum_functional import quantum_functional, h from tests.util import compile_guppy diff --git a/tests/integration/test_poly.py b/tests/integration/test_poly.py index 812f8bb9..54cb2407 100644 --- a/tests/integration/test_poly.py +++ b/tests/integration/test_poly.py @@ -7,10 +7,10 @@ from guppylang.decorator import guppy from guppylang.definition.custom import CustomCallCompiler from guppylang.module import GuppyModule -from guppylang.prelude.builtins import array -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import array +from guppylang.std.quantum import qubit -import guppylang.prelude.quantum as quantum +import guppylang.std.quantum as quantum def test_id(validate): diff --git a/tests/integration/test_py.py b/tests/integration/test_py.py index 79804178..7b945b89 100644 --- a/tests/integration/test_py.py +++ b/tests/integration/test_py.py @@ -6,9 +6,9 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.builtins import py, array -from guppylang.prelude import quantum -from guppylang.prelude.quantum import qubit +from guppylang.std.builtins import py, array +from guppylang.std import quantum +from guppylang.std.quantum import qubit from tests.util import compile_guppy tket2_installed = find_spec("tket2") is not None @@ -184,5 +184,3 @@ class Baz: xs: array[int, py(n)] validate(module.compile()) - - diff --git a/tests/integration/test_qalloc.py b/tests/integration/test_qalloc.py index 51162159..5667b74a 100644 --- a/tests/integration/test_qalloc.py +++ b/tests/integration/test_qalloc.py @@ -1,11 +1,11 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.quantum import qubit +from guppylang.std.quantum import qubit -from guppylang.prelude.quantum import dirty_qubit, measure -from guppylang.prelude.quantum_functional import cx +from guppylang.std.quantum import dirty_qubit, measure +from guppylang.std.quantum_functional import cx -import guppylang.prelude.quantum_functional as quantum_functional +import guppylang.std.quantum_functional as quantum_functional def test_dirty_qubit(validate): diff --git a/tests/integration/test_quantum.py b/tests/integration/test_quantum.py index c3f8ffd2..5a3deb66 100644 --- a/tests/integration/test_quantum.py +++ b/tests/integration/test_quantum.py @@ -7,16 +7,16 @@ import guppylang.decorator from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.angles import angle +from guppylang.std.angles import angle -from guppylang.prelude.builtins import owned, py -from guppylang.prelude.quantum import ( +from guppylang.std.builtins import owned, py +from guppylang.std.quantum import ( dirty_qubit, discard, measure, qubit ) -from guppylang.prelude.quantum_functional import ( +from guppylang.std.quantum_functional import ( cx, cy, cz, diff --git a/tests/integration/test_range.py b/tests/integration/test_range.py index da9104c4..2babd982 100644 --- a/tests/integration/test_range.py +++ b/tests/integration/test_range.py @@ -1,5 +1,5 @@ from guppylang.decorator import guppy -from guppylang.prelude.builtins import nat, range, SizedIter, Range +from guppylang.std.builtins import nat, range, SizedIter, Range from guppylang.module import GuppyModule from tests.util import compile_guppy @@ -43,4 +43,3 @@ def negative() -> SizedIter[Range, 10]: return range(10) validate(module.compile()) - diff --git a/tests/integration/test_result.py b/tests/integration/test_result.py index dea78add..33b12210 100644 --- a/tests/integration/test_result.py +++ b/tests/integration/test_result.py @@ -1,4 +1,4 @@ -from guppylang.prelude.builtins import result, nat, array +from guppylang.std.builtins import result, nat, array from tests.util import compile_guppy diff --git a/tests/integration/test_tket.py b/tests/integration/test_tket.py index dfb94c0a..9ff5b46d 100644 --- a/tests/integration/test_tket.py +++ b/tests/integration/test_tket.py @@ -17,11 +17,11 @@ from guppylang.decorator import guppy from guppylang.module import GuppyModule -from guppylang.prelude.angles import pi -from guppylang.prelude.builtins import owned, py -from guppylang.prelude import quantum -from guppylang.prelude.quantum import measure, qubit -from guppylang.prelude.quantum_functional import phased_x, rz, zz_max +from guppylang.std.angles import pi +from guppylang.std.builtins import owned, py +from guppylang.std import quantum +from guppylang.std.quantum import measure, qubit +from guppylang.std.quantum_functional import phased_x, rz, zz_max from tests.util import guppy_to_circuit tket2_installed = find_spec("tket2") is not None