Changelog¶
The Guppy language is distributed via the guppylang pypi package.
This changelog documents user-facing changes to the Guppy language excluding changes to the compiler internals. The Guppy compiler is versioned with the guppylang-internals package.
Versioning Policy¶
As of version 1.0.0, the Guppy language is considered stable. An extended changelog for this version can be found here.
1.0.1 (2026-08-03)¶
Guppy v1 is the first stable release of the Guppy quantum programming language. It introduces several major new features alongside a number of breaking changes and new behaviours.
While new features will still be added in subsequent minor versions and there may be changes to the standard library, the core language is now considered stable, meaning there won’t be any changes to the syntax and semantics of core language constructs.
This extended changelog intends to provide a convenient overview of major new features for Guppy v1. The standard detailed changelog for this specific release can be found at the end of it, and you may also be interested in the changelog for the release candidates and alpha releases. See the language guide for detailed feature documentation.
To see just the breaking changes and instructions on how to update existing code, please see the migration guide.
New quantum constructs¶
A new Measurement type¶
Guppy has a new dedicated Measurement type. Values returned from measurement functions now have this type instead of returning a bool directly. See the language guide section on measurements for the design rationale behind this and the relevant migration guide section here.
Control and dagger modifiers¶
Gates, blocks of quantum operations, and functions can now be transformed automatically using modifiers. Control makes each operation controlled with an additional control qubit input. Dagger reverses gate order and replaces each gate with its inverse.
from guppylang.decorator import guppy
from guppylang.std.quantum import s, qubit
from guppylang.std.builtins import control, dagger
@guppy
def controlled_inverse(c: qubit, q: qubit) -> None:
with control(c), dagger:
s(q)
See the modifier guide for usage details and examples.
Extensions to the type system¶
Protocols¶
Protocols are a powerful way of constraining polymorphism: they let you define a set of required methods, and any type that implements all of them automatically satisfies the protocol.
from typing import Self
from guppylang.std.quantum import Measurement
@guppy.protocol
class Measurable:
@guppy.require
def measure(self: Self) -> Measurement: ...
Guppy v1 also introduces some special built-in protocols, namely Callable (see the migration guide for what this means for previous use of Callable).
Read more about protocols in the language guide.
Structs are now mutable¶
Structs are now mutable by default, also making them affine by default, see the relevant migration guide section here.
Type aliases¶
Guppy now provides the ability to give an existing type another name using the guppy.type_alias function. Read more about type aliases in the language guide.
Comptime improvements¶
More support for generics¶
Generic variables can now be used in the type signature of comptime functions. However, explicitly specifying type arguments for both functions and structs is not supported yet.
Read more about comptime and generics in their respective language guide sections.
Python variables are now captured implicitly¶
The use of comptime (or py) is no longer required to pull in variables from Python code into Guppy code, these will be captured implicitly. Anything requiring any form of computation still requires the comptime keyword.
Performance¶
A new optimisation interface¶
It is now possible to specify the level of optimization to be run on Guppy programs by calling with_opt_level on the entrypoint function. Read more about the different available optimization levels and defaults here.
Runtime argument support in the emulator¶
When using the emulator, it is now possible to compile a program once and re-run it for different parameters by using runtime arguments. Find out more about this here.
Changes to the Standard Library¶
Besides the additions and changes mentioned below, there are some deprecations and renames which are listed in the migration guide.
std.qsystem is now split into helios and sol¶
Guppy v1 splits previous std.qsystem functionality into std.qsystem.helios and std.qsystem.sol modules, as well as adding compilation target platform configuration support. Read about the differences between the modules and how platform configuration affects emulator and compilation workflows in the relevant documentation.
A new std.random module¶
Alongside the platform random number generator (found in std.qsystem.random), Guppy now also offers a native implementation that stores state locally rather than globally. Read more about both forms of RNG in the language guide.
⚠ BREAKING CHANGES¶
Stop treating protocol bounds as always copyable and droppable (#2142)
Type args to Either/Result factory methods
right/errare now the same way round (#2139)
Bug Fixes¶
Make most builtin functions + struct constructors daggerable (#2151)(e7fbacb)
Preserve generic parameters in modifier blocks (#2146)(cfa9b98)
Correctly parse modifier protocol bounds (#2144)(c49798b)
Stop treating protocol bounds as always copyable and droppable (#2142)(6f4fbab)
Type args to Either/Result factory methods
right/errsame way round (#2139)(09f6baf)Correctly derive linearity of structs from their fields (#2135)(ccd42a9)
Fix comptime inout updates for
state_output(and other custom) functions (#2132)(4fbd07a)Unitary checker skips invalid function calls in arguments (#2131)(524a11c)
Documentation¶
Features¶
Add RemoveRedundancies pass to default compilation (#2148)(8f29b43)
1.0.0-rc2 (2026-07-17)¶
⚠ BREAKING CHANGES¶
Raise an error if non daggerable classical functions are used in dagger cotext (#2066)
Bug Fixes¶
Features¶
1.0.0-rc1 (2026-07-07)¶
Bug Fixes¶
Documentation¶
Correct formatting in docstrings for GuppyLibrary and EmulatorBuilder (#2019)(29ef921)
1.0.0-rc0 (2026-07-02)¶
⚠ BREAKING CHANGES¶
Drop support for Python 3.10 and 3.11 (#1985)
Remove
max_qubitsfromGuppyKwargsTypedDict (#1977)Optimization is now enabled by default in compilation workflows (#1885)
Code Refactoring¶
Remove
max_qubitsfromGuppyKwargsTypedDict (#1977)(b5ca042)
Features¶
1.0.0-a8 (2026-06-30)¶
⚠ BREAKING CHANGES¶
Add
@expected_qubitsdecorator and removemax_qubitskwarg (#1942)Bump
hugrandtketdependencies to 0.18 and 0.15 resp. (#1963)Add
@link_namedecorator and removelink_namekwarg (#1941)Add
@metadatadecorator (#1937)
Features¶
Runtime entrypoint arguments for the emulator (#1890)(cbd603c)
Add
@expected_qubitsdecorator and removemax_qubitskwarg (#1942)(a50e5fb)Bump
hugrandtketdependencies to 0.18 and 0.15 resp. (#1963)(bb90943)Add hint to error when passing
Measurementvalues tooutput(#1955)(85d3b94)Add
@link_namedecorator and removelink_namekwarg (#1941)(728baed)Add
@metadatadecorator (#1937)(206d309)
1.0.0-a7 (2026-06-25)¶
Note that this release raises the minimum compatible version of pytket to 2.7.0.
⚠ BREAKING CHANGES¶
Move libraries into their own module (#1930)
Mark unitary callable interfaces as experimental (#1927)
Bug Fixes¶
Mark unitary callable interfaces as experimental (#1927)(ac12917)
Code Refactoring¶
Move libraries into their own module (#1930)(dd5ca00)
Features¶
1.0.0-a6 (2026-06-24)¶
⚠ BREAKING CHANGES¶
Return
Measurementfromguppylang.quantum.project_z(#1896)Remove deprecated reexports and leave custom import errors (#1886)
Remove deprecated decorators, functions, and sync dummy interface (#1855)
Code Refactoring¶
Return
Measurementfromguppylang.quantum.project_z(#1896)(1d67161)Remove deprecated reexports and leave custom import errors (#1886)(3c19192)
Remove deprecated decorators, functions, and sync dummy interface (#1855)(68b217c)
Rename result and state_result to output and state_output (#1871)(a6a6ff6)
Features¶
1.0.0-a5 (2026-06-15)¶
Features¶
Bug Fixes¶
1.0.0-a4 (2026-06-12)¶
⚠ BREAKING CHANGES¶
Features¶
Code Refactoring¶
1.0.0-a3 (2026-06-10)¶
⚠ BREAKING CHANGES¶
Remove
powerflags and rename flagdaggertodaggerableandcontroltocontrollable(#1838)Use mutable state for PCG32 and encapsulate internals (#1828)
Remove vacuous pytket extra from distributions (#1836)
Use mutable structs for std collections and encapsulate internals (#1796)
Experimental features should only be enabled globally (#1825)
Features¶
Code Refactoring¶
1.0.0-a2 (2026-06-08)¶
⚠ BREAKING CHANGES¶
Make structs mutable by default (#1795)
Features¶
1.0.0-a1 (2026-06-04)¶
Features¶
Documentation¶
1.0.0-a0 (2026-05-29)¶
⚠ BREAKING CHANGES¶
Protocol parsing (#1754)
Features¶
Documentation¶
Miscellaneous Chores¶
0.21.12 (2026-04-16)¶
Features¶
Add
lazy_measure_and_resetqsystem operation (7b63997)Joint compilation of Guppy symbols to a library (0adefdb)
Monomorphise everything during type checking (bde8404)
Support for compilation unit, subprogram and location debug metadata (c0ff4d3)
Support modifiers on compile time functions (ca65da4)
Performance Improvements¶
0.21.11 (2026-04-01)¶
Features¶
Bug Fixes¶
Documentation¶
0.21.10 (2026-03-23)¶
Features¶
Bug Fixes¶
Documentation¶
0.21.9 (2026-02-18)¶
Features¶
Add function to swap two array elements that lowers to hugr swap op (#1459) (15da521)
Add missing bool methods (rxor, rand, ror) (#1498) (6078136)
Allow panicking with different signal values (#1461) (e624d4f)
Compile time array bounds check for literal indices (#1438) (d2dd890)
Lower nat to int conversion to
iu_to_shugr op (#1480) (2ba5720)
Bug Fixes¶
Documentation¶
0.21.8 (2026-01-09)¶
Features¶
Bug Fixes¶
Convert symbolic pytket circuits angle inputs into rotations (#1425) (4724d90)
Fix Hugr generation for tuples in
ResultandEither(#1395) (f8b0d47), closes #1388Improve diagnostics rendering for wasm (#1399) (6604175), (#1398) (a6a539f)
Support comptime expressions in generic argument applications (#1409) (c1aad34), closes #1087
0.21.7 (2025-12-15)¶
Features¶
Bug Fixes¶
Miscellaneous Chores¶
Code Refactoring¶
0.21.6 (2025-10-29)¶
Features¶
0.21.5 (2025-09-22)¶
[!WARNING] The
.compile()method now assumes the function being compiled is an execution entrypoint and therefore checks it takes no arguments. If you have an existing workflow that produces a HUGR with a non-executable function this will break, usecompile_functioninstead.
Features¶
0.21.4 (2025-09-19)¶
Features¶
Bug Fixes¶
Documentation¶
Miscellaneous Chores¶
0.21.3 (2025-08-19)¶
Features¶
Bug Fixes¶
Documentation¶
Extended emulator docs (20651db)
Several docstring fixes
0.21.2 (2025-08-11)¶
Features¶
We can now pass a
startandstepfor the range function just as we can in Python. (#1157) (a1b9333)Update to guppylang-internals 0.22.0
Support float parameters as inputs to symbolic circuits loaded with
guppy.load_pytket. (#1105) (34c546c), closes #1076 (see example below).
from guppylang import guppy
from guppylang.std.angles import pi
from guppylang.std.quantum import qubit, rx, discard
from pytket import Circuit
from sympy import Symbol
a = Symbol("alpha")
circ = Circuit(1, 1)
circ.Rx(a, 0)
circ.Measure(0, 0)
rx_func = guppy.load_pytket("rx", circ, use_arrays=False)
@guppy
def perform_rx_flip() -> int:
"""Perform an X gate as Rx(q, pi)"""
q = qubit()
res = int(rx_func(q, pi))
discard(q)
return res
perform_rx_flip.check()
Bug Fixes¶
Documentation¶
0.21.1 (2025-08-05)¶
Bug Fixes¶
Documentation¶
0.21.0 (2025-08-04)¶
⚠ BREAKING CHANGES¶
All compiler-internal and non-userfacing functionality is moved into a new
guppylang_internalspackageguppy.compile(foo)andguppy.check(foo)are both now deprecated and will be removed in a future release. Their usage should be replaced withfoo.compile()andfoo.check().The
mainfunction no longer has a special status in Guppy. Any function which takes no arguments can be a valid entrypoint to a program.default HUGR output uses compressed binary encoding.
guppylang.tracing.object.GuppyDefinitionmoved toguppylang.defs.GuppyDefinitionguppylang.tracing.object.TypeVarGuppyDefinitionmoved and renamed toguppylang.defs.GuppyTypeVarDefinitionAll
to_hugrmethods on types, arguments, and parameters now require aToHugrContextCompilableDef.compile_outernow requires aToHugrContextguppy.hugr_opnow passes the compiler context to the function generating the opCheckedFunctionDefnow implementsMonomorphizableDefinstead ofCompilableDefCompilerContext.build_compiled_defnow requires an instantiation for the definition’s type parameters TheToHugrContextprotocol now requires two additional methods:type_var_to_hugrandconst_var_to_hugrCompilerContext.{compiled, worklist}andCompilationEngine.compiledare now indexed by a tuple ofDefIdand optionalPartiallyMonomorphizedArgsAny comptime code that previously used constant integers outside the 64-bit signed integer range will now fail to compile.
Capturing closures are now disabled by default. Enabling them requires calling
guppylang.enable_experimental_features(), however note that they are not supported throughout the stack.
Features¶
Add emulation of Guppy programs powered by the Selene framework (#1127)(5e2f595). See the Getting Started guide and the Examples Gallery for example usage.
add error when constant integer out of bounds (#1084) (eee77ae)
Add guppy version metadata to hugr entrypoint (#1039) (0eafbd9), closes #1037
add selene via optional feature and use for testing (#1081) (cefc70e)
Extend comptime arguments to arbitrary non-linear types (#1110) (384dd8c)
store used extensions and versions in HUGR metadata (#1049) (a9a300c), closes #1048
Support arbitrary const generics via monomorphisation (#1033) (bcf9865)
Support Python 3.12 generic syntax (#1051) (ab2e118), closes #823
Bug Fixes¶
Allow array comprehension syntax in comptime functions (#1068) (da8f04a), closes #1067
Allow struct redefinitions for Python < 3.13 (#1108) (959a4e4), closes #1107
Correctly detect
[@custom](https://github.com/custom)_guppy_decoratorin nested scopes (#1086) (678583c)Fix diagnostics rendering for comptime entrypoints (#1099) (fdd2676), closes #1097
Fix frame lookup for Python 3.12 annotation scopes (#1120) (a69e489), closes #1116
Fix hugr conversion and bounds checks on numeric literals (#1100) (73d5e92)
Fix nested function definitions in Python 3.12 (#1064) (090f920)
Stop showing temporary variables in comptime diagnostics (#1112) (63854c5), closes #1111
Turn capturing closures into experimental feature (#1065) (a959b18)
Documentation¶
Code Refactoring¶
0.20.0 (2025-06-19)¶
⚠ BREAKING CHANGES¶
Explicit Guppy modules have been removed. Instead, use the regular @guppy decorator everywhere without passing an explicit module. Compilation is now triggered via the .compile method.
0.19.0 syntax¶
@guppy
def main() -> None:
...
guppy.compile_module()
0.20.0 syntax¶
@guppy
def main() -> None:
...
main.compile()
Features¶
with_ownedstd library function to temporarily take ownership of a borrowed value (#994) (7bf75df), closes #992Add an Either type to the standard library. (#993) (75c1804), closes #991
Added a PriorityQueue structure to the standard library.
Guppy programs can now include
state_resulttags which can be used together with Selene to retrieve the statevector at a given point in the program execution (#905) (2217bbc). See the example notebook on Debugging with State Results.Add optional signature argument to RawCustomFunctionDef (#1005) (79e2d5b), closes #1003
Allow users to wrap
guppyin their own decorator (#1017) (f047c9b)diagnostics: add miette bindings for enhanced error rendering (#998) (c8f2724)
Function overloading via static dispatch (#1000) (6f523d6). See the corresponding section of the language guide for more information.
Bug Fixes¶
Documentation¶
0.19.1 (2025-05-27)¶
Features¶
Bug Fixes¶
0.19.0 (2025-05-22)¶
⚠ BREAKING CHANGES¶
Bools in HUGRs generated by Guppy are represented using a
tket2.boolinstead of the HUGR sum typedeprecated
hresultandqsys_resultmodules have been removed. Usehugr.qysystem.resultdirectly.Generated HUGRs now refer to entrypoints and are always modules in envelopes.
Features¶
Bug Fixes¶
Documentation¶
Code Refactoring¶
0.18.2 (2025-05-19)¶
Features¶
Bug Fixes¶
Better error message for unsupported generic comptime functions (#951) (35bfbcb), closes #944
Capture entire Python scope when defining comptime functions (#952) (898a033), closes #945
Fix
result/panic/exitcalls in comptime functions (#949) (ac4a515)Fix resolution of generic lengths in array constructor (#940) (0f1d5db)
Fix too narrow rendering of indented diagnostic labels (#933) (94821aa), closes #916
Use correct copyable/droppable terminology for type arg errors (#935) (6a44a1c), closes #867
0.18.1 (2025-04-26)¶
Features¶
Bug Fixes¶
add missing compilation for int rshift (#885) (5cd9225), closes #886
Allow standalone compilation of pytket functions (#903) (6416513)
deprecate zz_max and define in terms of zz_phase (#917) (85f5f6b), closes #914
Fix diagnostics spans for dynamically defined notebook functions (#907) (51b1b81), closes #906
0.18.0 (2025-03-25)¶
⚠ BREAKING CHANGES¶
Lists loaded from
py(...)expressions are now turned into immutablefrozenarrays instead of regulararrays.Guppy decorators now return instances of
GuppyDefinition
Features¶
0.17.1 (2025-03-24)¶
Features¶
Bug Fixes¶
qsystem: remove unsupported random_nat and maybe_rng (635e7ed)
Documentation¶
0.17.0 (2025-03-18)¶
⚠ BREAKING CHANGES¶
load_pytkettakes arrays by default (passuse_arrays=Falsefor qubit arguments)Optionis now a builtin type.angle.{__mul__, __rmul__, __truediv__, __rtruediv__now take afloatinstead of anint.
Features¶
add
Option.unwrap_nothing()method (#829) (abb1aa1), closes #810Allow explicit application of type arguments (#821) (8f90c04), closes #770
Generalise scalar angle operations to float (#824) (d3f5c7f)
Implement
floattointandnatcasts (#831) (b56d66c), closes #794qsystem: add Random number generation module (08fbf47)
Bug Fixes¶
Correctly handle assignments of arrays in control-flow (#845) (32ded02), closes #844
Define
lenof arrays using Guppy (#863) (6868ff6), closes #804Fix array comprehensions with generic element type (#865) (50df0db), closes #864
Fix compiler diagnostics when calling
checkinstead ofcompile(#854) (9993338)Fix diagnostic spans for indented code (#856) (d9fc9fd), closes #852
Fix error message for conditional shadowing of global variables (#815) (bdaae11), closes #772
Fix linearity checking for array copies (#841) (d9b085f), closes #838
Fix rendering of line breaks in diagnostics (#819) (75efd22), closes #818
Prevent reordering of operations with side-effects (#855) (75eb441)
Documentation¶
0.16.0 (2025-02-19)¶
⚠ BREAKING CHANGES¶
CompiledGlobalsrenamed toCompilerContext
Features¶
Code Refactoring¶
0.15.0 (2025-02-07)¶
⚠ BREAKING CHANGES¶
classical arrays can no longer be implicitly copied
pytketcircuits no longer supported bypyexpressions (use@pytketorload_pytketinstead)
Features¶
Bug Fixes¶
Documentation¶
0.14.0 (2024-12-19)¶
⚠ BREAKING CHANGES¶
Lists in
py(...)expressions are now turned into Guppy arrays instead of lists.dirty_qubitfunction removedmeasure_return renamed to
project_z
Features¶
add
maybe_qubitstdlib function (#705) (a49f70e), closes #627add measure_array and discard_array quantum function (#710) (3ad49ff)
Add method to load pytket circuit without function stub (#712) (ee1e3de)
Allow generic nat args in statically sized ranges (#706) (f441bb8), closes #663
Implicit coercion of numeric types (#702) (df4745b), closes #701
Load
pytketcircuit as a function definition (#672) (b21b7e1)qsystem std functions with updated primitives (#679) (b0f041f)
Unpacking assignment of iterable types with static size (#688) (602e243)
Bug Fixes¶
Accept non-negative int literals and py expressions as nats (#708) (a93d4fe), closes #704
Allow borrowing inside comprehensions (#723) (02b6ab0), closes #719
Detect unsupported default arguments (#659) (94ac7e3), closes #658
Ensure
ints can be treated as booleans (#709) (6ef6d60), closes #681Fix implicit modules in IPython shells (#662) (4ecb5f2), closes #661
Properly report error for unsupported constants (#724) (d0c2da4), closes #721
Properly report errors for unsupported expressions (#692) (7f24264), closes #691
Documentation¶
0.13.1 (2024-11-15)¶
Features¶
Bug Fixes¶
0.13.0 (2024-11-12)¶
⚠ BREAKING CHANGES¶
preludemodule renamed tostd
Features¶
Bug Fixes¶
Documentation¶
Miscellaneous Chores¶
Code Refactoring¶
0.12.2 (2024-10-21)¶
Features¶
Bug Fixes¶
0.12.1 (2024-09-23)¶
Features¶
Miscellaneous Chores¶
0.12.0 (2024-09-18)¶
⚠ BREAKING CHANGES¶
Pytket circuits loaded via a
pyexpression no longer take ownership of the passed qubits.Lists and function tensors are no longer available by default.
guppylang.enable_experimental_features()must be called before compilation to enable them.The
GuppyModuleargument is now optional for all decorators and no longer the first positional argument. Removed the explicit module objectsbuiltins,quantum, andangle.quantum_functionalis now its own Guppy module and no longer implicitly comes withquantum.Linear function arguments are now borrowed by default; removed the now redundant
@inoutannotation
Features¶
Add functions to quantum module and make quantum_functional independent (#494) (0b0b1af)
Hide lists and function tensors behind experimental flag (#501) (c867f48)
Make linear types @inout by default; add @owned annotation (#486) (e900c96)
Only lower definitions to Hugr if they are used (#496) (cc2c8a4)
Support implicit modules for all decorators and turn builtins into implicit module (#476) (cc8a424)
Bug Fixes¶
0.11.0 (2024-09-11)¶
⚠ BREAKING CHANGES¶
guppy.take_modulerenamed toguppy.get_moduleand no longer removes the module from the state.Quantum operations
rx,rz,phased_x, andzz_maxuse theangletype instead of floats.
Features¶
Bug Fixes¶
0.10.0 (2024-09-11)¶
⚠ BREAKING CHANGES¶
Bumped the
hugrdependency to0.8.0GuppyModule.loadno longer loads the content of modules but instead just brings the name of the module into scope. UseGuppyModule.load_allto get the old behaviour.Removed
guppylang.hugr_builder.hugr.Hugr, compiling a module returns ahugr.Packageinstead.
Features¶
Add equality test for booleans (#394) (dd702ce), closes #363
Add qualified imports and make them the default (#443) (553ec51)
Allow imports of function definitions and aliased imports (#432) (e23b666)
Inout arguments (#311) (060649b), closes #315 #316 #349 #344 #321 #331 #350 #340 #351
Use cell name instead of file for notebook errors (#382) (d542601)
Use the hugr builder (536abf9)
Bug Fixes¶
Documentation¶
Miscellaneous Chores¶
0.9.0 (2024-08-12)¶
⚠ BREAKING CHANGES¶
Bug Fixes¶
0.8.1 (2024-08-08)¶
Bug Fixes¶
0.8.0 (2024-07-30)¶
Features¶
Bug Fixes¶
0.7.0 (2024-07-25)¶
⚠ BREAKING CHANGES¶
qubits are now reset on allocation
Features¶
Bug Fixes¶
0.6.2 (2024-07-10)¶
Features¶
update to hugr-python 0.4 (af770c3)
0.6.1 (2024-07-09)¶
Features¶
update to
hugr-py 0.3(3da3936)
0.6.0 (2024-07-02)¶
Features¶
Bug Fixes¶
0.5.2 (2024-06-13)¶
Bug Fixes¶
0.5.1 (2024-06-12)¶
Bug Fixes¶
0.5.0 (2024-06-10)¶
Features¶
0.4.0 (2024-05-30)¶
Features¶
Export py function (6dca95d)
0.3.0 (2024-05-22)¶
Features¶
Bug Fixes¶
Documentation¶
0.2.0 (2024-04-11)¶
⚠ BREAKING CHANGES¶
Make
qubittype lower case (#165)
Features¶
Bug Fixes¶
Documentation¶
Code Refactoring¶
Continuous Integration¶
0.1.0¶
First release of Guppy! 🐟
This is an alpha release that implements basic language features and compilation to hugr v0.1.