# Guppy > Guppy is a quantum-first programming language embedded in Python. It is used to write quantum programs with measurement-dependent control flow, strong types, qubit safety and compile-time metaprogramming, and then execute them on quantum hardware or simulators: the Selene emulator, emulators available through the Nexus Console, and Quantinuum Helios. Key facts: - Install with `pip install guppylang`. Guppy can also be tried in the browser, with nothing to install, at https://play.guppylang.org. - Programs are Python functions decorated with `@guppy` (`from guppylang import guppy`); quantum operations come from `guppylang.std.quantum`. Guppy is statically typed and compiled, so check [Differences between Guppy and Python](https://docs.quantinuum.com/guppy/language_guide/python_differences.html) before assuming Python semantics. - Qubits are linear values: they cannot be copied or implicitly discarded, and cannot be used after a destructive measurement. Measurement and `discard` consume a qubit; gates borrow it. Most ownership errors from the compiler come from these rules. - Programs are emulated locally with Selene through the `guppylang.emulator` module; Selene is included with guppylang. - Fault-tolerant programs use Guppy FT (`pip install guppyft`), documented under [/guppy/ft/](https://docs.quantinuum.com/guppy/ft/). Reusable algorithmic primitives come from Guppy Algorithms (`guppyalgos`), documented under [/guppy/algorithms/](https://docs.quantinuum.com/guppy/algorithms/). - These docs cover Guppy 1.x. Code written for Guppy 0.x may need the [1.0 migration guide](https://docs.quantinuum.com/guppy/v1_migration.html); legacy 0.x docs remain under /guppy-v0.x/. - Source code and issues: https://github.com/quantinuum/guppylang ## Getting started - [Getting started](https://docs.quantinuum.com/guppy/getting_started.html): Install Guppy and run a first program. - [FAQs](https://docs.quantinuum.com/guppy/faqs.html): When to use Python versus Guppy, using Guppy with Qiskit and other tools, pytket OpTypes and Boxes, angles, and "unsupported", "no lowering found" and type checker errors. - [Migrating to Guppy from pytket](https://docs.quantinuum.com/guppy/migration_guide.html): Load pytket circuits into Guppy programs and translate pytket habits. - [Migrating to Guppy 1.0](https://docs.quantinuum.com/guppy/v1_migration.html): Breaking changes when upgrading from Guppy 0.x. - [Release notes](https://docs.quantinuum.com/guppy/release_notes.html): Changes in each guppylang release. ## Language guide - [Language guide overview](https://docs.quantinuum.com/guppy/language_guide/language_guide_index.html): Index of every Guppy language feature. - [Differences between Guppy and Python](https://docs.quantinuum.com/guppy/language_guide/python_differences.html): Python features that behave differently or are unsupported. - [Ownership and linear types](https://docs.quantinuum.com/guppy/language_guide/ownership.html): Qubit ownership, borrowing, consuming and the compile-time safety guarantees. - [Measurements](https://docs.quantinuum.com/guppy/language_guide/measurement.html): Measuring qubits and using results. - [Control flow](https://docs.quantinuum.com/guppy/language_guide/control_flow.html): Measurement-dependent branching and loops. - [Functions](https://docs.quantinuum.com/guppy/language_guide/functions.html): Defining and calling Guppy functions. - [Data types](https://docs.quantinuum.com/guppy/language_guide/data_types/types_index.html): Arrays, tuples, structs, angles and type aliases. - [Comptime](https://docs.quantinuum.com/guppy/language_guide/comptime.html): Compile-time metaprogramming. - [Static compilation and typing](https://docs.quantinuum.com/guppy/language_guide/static.html): How Guppy programs are type-checked and compiled. - [Modifiers](https://docs.quantinuum.com/guppy/language_guide/modifiers/modifiers_index.html): Controlled and daggered (adjoint) operations. - [Random number generation](https://docs.quantinuum.com/guppy/language_guide/random.html): Random numbers inside Guppy programs. ## API reference - [guppylang API](https://docs.quantinuum.com/guppy/api/api_index.html): Index of the guppylang Python API. - [@guppy decorator](https://docs.quantinuum.com/guppy/api/decorator.html): Declaring Guppy functions, structs and other definitions. - [Standard library](https://docs.quantinuum.com/guppy/api/std.html): Quantum gates, measurement, builtins, arrays, options, randomness and Helios-specific operations. - [Emulator](https://docs.quantinuum.com/guppy/api/emulator.html): Running Guppy programs on the Selene emulator from Python. ## Examples - [Examples gallery](https://docs.quantinuum.com/guppy/examples_index.html): All Guppy examples. - [T state distillation and the Option type](https://docs.quantinuum.com/guppy/guppylang/examples/t_factory.html): Measurement-dependent QEC protocols. - [Postselection: exit and panic](https://docs.quantinuum.com/guppy/guppylang/examples/postselect.html): Ending a shot early when an error is detected. - [N-qubit GHZ and graph state preparation](https://docs.quantinuum.com/guppy/guppylang/examples/ghz_and_graph.html): Scalable, type-safe state preparation. - [Repeat until success](https://docs.quantinuum.com/guppy/guppylang/examples/repeat-until-success.html): Looping on measurement outcomes. - [The SWAP test and loading pytket circuits](https://docs.quantinuum.com/guppy/guppylang/examples/swap_test.html): Using pytket circuits inside Guppy programs. - [Debugging with state_output statements](https://docs.quantinuum.com/guppy/guppylang/examples/state_results.html): Inspecting the quantum state during emulation. ## Guppy FT and Guppy Algorithms - [Make a program fault tolerant with Guppy FT](https://docs.quantinuum.com/workflows/fault-tolerance/): Guided workflow: encode a Guppy program with the Steane code and run it on the Helios emulator. - [Guppy FT documentation](https://docs.quantinuum.com/guppy/ft/): Getting started with automatic QEC encoding. - [Guppy FT API](https://docs.quantinuum.com/guppy/ft/api/api.html): The guppyft Python API, including the Steane code. - [Guppy Algorithms documentation](https://docs.quantinuum.com/guppy/algorithms/): Library of reusable algorithmic primitives for Guppy programs. - [Guppy Algorithms getting started](https://docs.quantinuum.com/guppy/algorithms/getting-started.html): Installing and using guppyalgos. - [Guppy Algorithms examples](https://docs.quantinuum.com/guppy/algorithms/examples_index.html): Phase estimation, block encoding, Hamiltonian simulation, arithmetic, QROM and state preparation notebooks. ## Optional - [Write, emulate and run a program on Helios](https://docs.quantinuum.com/workflows/run-on-helios/): Guided end-to-end workflow from Guppy to Helios results. - [Selene documentation](https://docs.quantinuum.com/selene/llms.txt): Emulator details, simulators and error models. - [Submit a job to Helios](https://docs.quantinuum.com/systems/trainings/helios/getting_started/index.html): Running Guppy programs on Helios through Nexus. - [Guppy on System Model H2](https://docs.quantinuum.com/nexus/trainings/notebooks/basics/qir/guppy_to_qir.html): Compile Guppy to QIR for H2.