FSharp.Azure.Quantum.Topological
0.4.11
See the version list below for details.
dotnet add package FSharp.Azure.Quantum.Topological --version 0.4.11
NuGet\Install-Package FSharp.Azure.Quantum.Topological -Version 0.4.11
<PackageReference Include="FSharp.Azure.Quantum.Topological" Version="0.4.11" />
<PackageVersion Include="FSharp.Azure.Quantum.Topological" Version="0.4.11" />
<PackageReference Include="FSharp.Azure.Quantum.Topological" />
paket add FSharp.Azure.Quantum.Topological --version 0.4.11
#r "nuget: FSharp.Azure.Quantum.Topological, 0.4.11"
#:package FSharp.Azure.Quantum.Topological@0.4.11
#addin nuget:?package=FSharp.Azure.Quantum.Topological&version=0.4.11
#tool nuget:?package=FSharp.Azure.Quantum.Topological&version=0.4.11
FSharp.Azure.Quantum.Topological
Topological Quantum Computing Library for F#
A topological quantum computing library for F#, implementing anyon models, fusion rules, braiding operators, and gate-to-braid compilation. While topological quantum computing is a fundamentally different paradigm -- information is encoded in the topology of anyon worldlines rather than in quantum amplitudes -- this library integrates seamlessly with the gate-based library (FSharp.Azure.Quantum) via the shared IQuantumBackend interface, enabling standard algorithms (Grover, QFT, Shor, HHL) to run on topological backends.
Features
Mathematical Foundation (Layer 1)
- Anyon Species: Ising (Majorana), Fibonacci, and SU(2)_k particle types with quantum dimensions
- Fusion Rules: Non-abelian fusion algebra (e.g., sigma x sigma = 1 + psi)
- Braiding Operators: R-matrices (braiding phases) and F-matrices (fusion basis changes)
- Modular Data: S-matrix, T-matrix, topological central charge
- Knot Invariants: Kauffman bracket and Jones polynomial via
KauffmanBracket - Consistency Verification: Pentagon and hexagon equation checks
Backends and Operations (Layers 2-3)
- TopologicalUnifiedBackend: Implements
IQuantumBackendfor seamless integration with gate-based algorithms - TopologicalUnifiedBackendFactory: Factory functions (
createIsing,createFibonacci,create) - Fusion Trees: Quantum state representation as recursive tree structures
- TopologicalOperations: Braiding, fusion measurement, superposition management
Algorithms and Compilation (Layers 4-5)
- Magic State Distillation: 15-to-1 protocol for Ising anyon universality
- Toric Code: Topological error correction with MWPM decoder
- Surface Code Variants: Planar code (open boundaries, boundary matching) and color code (4.8.8 lattice, greedy decoder)
- Anyonic Error Correction: Fusion-tree-level charge violation detection, syndrome extraction, greedy charge-correction decoder, code space projection
- Gate-to-Braid Compilation: Translate gate-based circuits to braid sequences (21 gate types)
- Braid-to-Gate: Convert braid sequences back to gate operations
- Solovay-Kitaev: Gate approximation for efficient braid decomposition
- Algorithm Extensions: Run Grover, QFT, Shor, and HHL on topological backends via
IQuantumBackend - Knot Invariants: Kauffman bracket, Jones polynomial, and standard knot constructors (trefoil, figure-eight, Hopf link, etc.)
Developer Experience (Layer 6)
- Computation Expressions:
topological backend { ... }builder for composing programs - TopologicalFormat: Import/export
.tqpfiles (human-readable format) - Noise Models: Configurable noise simulation for realistic error modelling
- Visualization: State visualization and debugging utilities
- TopologicalHelpers: Complex number utilities and display formatting
Installation
# Build the library
dotnet build src/FSharp.Azure.Quantum.Topological/FSharp.Azure.Quantum.Topological.fsproj
# Run tests
dotnet test tests/FSharp.Azure.Quantum.Topological.Tests/FSharp.Azure.Quantum.Topological.Tests.fsproj
Quick Start
Low-level API: Fusion and braiding primitives
open FSharp.Azure.Quantum.Topological
// Define Ising anyons
let sigma = AnyonSpecies.Particle.Sigma
let ising = AnyonSpecies.AnyonType.Ising
// Fuse two sigma anyons (non-abelian!)
let outcomes = FusionRules.fuse sigma sigma ising
// Result: [Vacuum; Psi] - two possible outcomes encode a qubit
// Get braiding phase
let R = BraidingOperators.element sigma sigma AnyonSpecies.Particle.Vacuum ising
// Result: e^(i*pi/8) - topological phase from braiding
// Check quantum dimension
let d = AnyonSpecies.quantumDimension sigma
// Result: sqrt(2) ~ 1.414
Computation expression: Backend-agnostic programs
open FSharp.Azure.Quantum.Topological
let backend = TopologicalUnifiedBackendFactory.createIsing 10
let program = topological backend {
let! state = initialize AnyonSpecies.AnyonType.Ising 4 // Create 4 sigma anyons
do! braid 0 // Braid anyons 0 and 1
do! braid 2 // Braid anyons 2 and 3
let! outcome = measure 0 // Measure fusion of pair 0
return outcome
}
Running gate-based algorithms on topological backends
open FSharp.Azure.Quantum.Topological
// The topological backend implements IQuantumBackend, so standard algorithms work directly
let backend = TopologicalUnifiedBackendFactory.createIsing 20
// Grover search on topological backend (gate-to-braid compilation happens automatically)
let groverResult = AlgorithmExtensions.searchSingleWithTopology 42 8 backend config
// QFT on topological backend
let qftResult = AlgorithmExtensions.qftWithTopology 4 backend qftConfig
// Shor's factoring on topological backend
let shorResult = AlgorithmExtensions.factor15WithTopology backend
Railway-oriented composition
let backend = TopologicalUnifiedBackendFactory.createIsing 10
// Sequential operations using Result.bind
match backend.InitializeState 2 with
| Ok state ->
match backend.ApplyOperation (QuantumOperation.Braid 0) state with
| Ok braided ->
match backend.ApplyOperation (QuantumOperation.Measure 0) braided with
| Ok measured -> printfn "Measured: %A" measured
| Error e -> printfn "Measure error: %s" e.Message
| Error e -> printfn "Braid error: %s" e.Message
| Error e -> printfn "Init error: %s" e.Message
Test Coverage
807 unit tests covering all 29 modules across 6 architectural layers:
dotnet test tests/FSharp.Azure.Quantum.Topological.Tests/
Tests validate mathematical consistency (Pentagon/Hexagon equations, unitarity, fusion axioms), backend operations, computation expressions, format parsing, knot invariants, magic state distillation, and more.
Architecture
The library follows a strictly layered architecture that mirrors the gate-based library's structure, integrating via the shared IQuantumBackend interface:
Layer 6: Builders & Formats TopologicalBuilder, TopologicalFormat, Visualization,
TopologicalHelpers
Layer 5: Compilation GateToBraid, BraidToGate, SolovayKitaev, CircuitOptimization,
AlgorithmExtensions
Layer 4: Algorithms MagicStateDistillation, ToricCode, SurfaceCode,
AnyonicErrorCorrection, ErrorPropagation
Layer 3: Operations TopologicalOperations, FusionTree
Layer 2: Backends TopologicalUnifiedBackend, TopologicalUnifiedBackendFactory
Layer 1: Mathematical Foundation AnyonSpecies, FusionRules, BraidingOperators, FMatrix,
RMatrix, ModularData, BraidGroup, BraidingConsistency,
EntanglementEntropy, KauffmanBracket, KnotConstructors
Why a Separate Package?
| Gate-Based (FSharp.Azure.Quantum) | Topological (This Library) |
|---|---|
| Qubits, gates, circuits | Anyons, braiding, fusion |
| Amplitude vectors | Fusion trees |
| Z-basis measurement | Fusion outcome measurement |
| Error-prone (needs QEC) | Topologically protected |
| Azure Quantum integration | Simulator + IQuantumBackend integration |
Note: While the paradigms differ, the topological backend implements IQuantumBackend from the gate-based library, enabling standard algorithms (Grover, QFT, Shor, HHL) to run on topological backends via automatic gate-to-braid compilation.
Namespace Structure
FSharp.Azure.Quantum.Topological
Layer 1: AnyonSpecies, FusionRules, BraidingOperators, FMatrix, RMatrix,
ModularData, BraidGroup, BraidingConsistency, EntanglementEntropy,
KauffmanBracket, KnotConstructors
Layer 2: TopologicalUnifiedBackend, TopologicalUnifiedBackendFactory
Layer 3: FusionTree, TopologicalOperations
Layer 4: MagicStateDistillation, ToricCode, SurfaceCode,
AnyonicErrorCorrection, ErrorPropagation
Layer 5: GateToBraid, BraidToGate, SolovayKitaev, CircuitOptimization,
AlgorithmExtensions
Layer 6: TopologicalBuilder, TopologicalBuilderExtensions, TopologicalFormat,
NoiseModels, Visualization, TopologicalHelpers, TopologicalError
Examples
Working examples are in examples/Topological/:
| Example | Description |
|---|---|
BasicFusion.fsx |
Fusion rules and anyon properties |
BellState.fsx |
Topological Bell state preparation |
BackendComparison.fsx |
Compare simulator backends |
FormatDemo.fsx |
.tqp format import/export |
MagicStateDistillation.fsx |
T-gate via 15-to-1 distillation |
ModularDataExample.fsx |
S/T matrices and modular invariants |
KauffmanJones.fsx |
Knot invariants from braiding |
TopologicalExample.fsx |
General topological operations |
TopologicalVisualization.fsx |
State visualization |
ToricCodeExample.fsx |
Toric code error correction |
bell-state.tqp |
Sample .tqp program file |
Documentation
- Architecture Guide -- Layered design, module dependencies, design principles
- Developer Deep Dive -- Comprehensive guide: paradigm shift, anyons, braiding, practical F# patterns
- Universal Quantum Computation -- Magic state distillation for Ising anyon universality
- Format Specification --
.tqpfile format reference
Background: Topological Quantum Computing
What are Anyons?
Anyons are quasiparticles in 2D systems with exotic exchange statistics -- neither bosonic nor fermionic. When you braid anyons around each other, the quantum state accumulates a topological phase that depends only on the braid pattern, not the specific path. This topological protection makes the stored quantum information exponentially resistant to local noise.
Implemented Anyon Theories
Ising Anyons (SU(2)_2) -- Microsoft's Majorana zero mode approach. Particles: {1, sigma, psi}. Supports Clifford gates natively; needs magic state distillation for universality. Physically realizable.
Fibonacci Anyons -- Universal for quantum computation via braiding alone. Particles: {1, tau}. Golden ratio phi appears throughout. Not yet physically realized.
SU(2)_k (General) -- Framework for arbitrary Chern-Simons levels with computational basis encoding. k=2 (Ising) and k=3 are tested. SpinJ particles with truncated spins for any level k.
Future Work
- Azure Quantum Majorana: Hardware backend integration (when available)
- Performance: GPU acceleration, sparse matrices, parallel braiding
- Advanced Noise Models: Thermal excitation, braiding imprecision beyond current NoiseModels
References
- Topological Quantum by Steven H. Simon (2023) -- Chapters 8-11
- Anyons in an exactly solved model and beyond -- Kitaev (2006)
- Non-Abelian Anyons and Topological Quantum Computation -- Nayak et al. (2008)
- Microsoft Quantum Documentation -- Majorana-based quantum computing
License
Same as parent project (FSharp.Azure.Quantum).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FSharp.Azure.Quantum (>= 1.4.11)
- FSharp.Core (>= 10.1.302)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.2 | 5 | 10/2/2026 |
| 0.5.1 | 38 | 10/1/2026 |
| 0.5.0 | 47 | 10/1/2026 |
| 0.4.15 | 56 | 9/30/2026 |
| 0.4.12 | 73 | 9/29/2026 |
| 0.4.11 | 95 | 9/26/2026 |
| 0.4.9 | 106 | 9/20/2026 |
| 0.4.8 | 87 | 9/18/2026 |
| 0.4.7 | 131 | 8/1/2026 |
| 0.4.6 | 131 | 7/11/2026 |
| 0.4.5 | 129 | 7/6/2026 |
| 0.4.4 | 128 | 7/3/2026 |
| 0.4.3 | 136 | 7/1/2026 |
| 0.4.2 | 132 | 6/30/2026 |
| 0.4.1 | 135 | 6/12/2026 |
| 0.3.11 | 151 | 3/31/2026 |
| 0.3.10 | 149 | 2/22/2026 |
| 0.3.9 | 135 | 2/19/2026 |
| 0.3.8 | 136 | 2/18/2026 |
| 0.3.7 | 138 | 2/17/2026 |
v0.4.11: Rebuilt against FSharp.Azure.Quantum v1.4.11
- CHANGED (memory): EntanglementEntropy.entanglementEntropy built the full density matrix ρ_AB = |ψ⟩⟨ψ| only to partial-trace it away — 16·4^n bytes, 4.3 GB at 14 qubits, and past the .NET array limit at 16. It now computes ρ_A straight from the amplitudes in dimA² memory: at 14 qubits split 7|7 the whole call allocates about 1 MB. Same eigenvalues and entropy, verified against the dense path for every split of 1-6 qubits. It also refuses non-positive subsystem dimensions itself, as the partial trace did before
- CHANGED: EntanglementEntropy.densityMatrix indexed its amplitude LIST inside the double loop, O(N³) for an O(N²) result; it converts to an array once. It is still dense by nature, and its doc now says so and points to entanglementEntropy
- CHANGED: the surface-code and toric-code matching graphs indexed the defect list inside their pairwise loop (cubic in the number of defects); they index an array now. Edge order is unchanged
- CHANGED: the native Grover diffusion computed the mean amplitude over all 2^n basis indices through a freshly built list; it now sums the stored non-zero amplitudes, which gives the same value, and yields the reflected terms without an intermediate index list
- Requires FSharp.Azure.Quantum v1.4.11+
v0.4.10: Rebuilt against FSharp.Azure.Quantum v1.4.10
- FIXED: TopologicalBackend.SupportsOperation returned true for every QPE intent, including the modular-exponentiation unitary its own ApplyOperation refuses. Shor's period-finding planner asks exactly this to decide whether the backend takes the intent whole, so the blanket answer would have routed it into a handler that then errored. It now answers by unitary
- FIXED (wrong results): the QFT intent used a controlled-rotation angle of 2*pi/2^(k-j) where the canonical lowering (QFT.fs and LocalBackend) uses 2*pi/2^(k-j+1). Every controlled rotation was twice the angle it should have been, so AlgorithmOperation.QFT returned a wrong state on this backend for any input that actually fired one. It survived because the QFT intent had no test here at all — it is covered only against the gate simulator in the core package
- NEW: the QFT now runs natively on the fusion encoding, exactly like the Grover and modular-exponentiation primitives — exact, and with no gate compilation, so no Solovay-Kitaev approximation. It handles a sub-register as well as a whole state, which is the case that matters for composition: an inverse QFT over a counting register inside a wider circuit
- The index convention is derived from the gate circuit rather than assumed. The circuit numbers qubit 0 as the MOST significant bit while the fusion encoding reads the register least-significant first, so the forward transform reverses the input index and the inverse reverses the output index, with ApplySwaps reversing whichever is left. Verified column by column: all four Inverse x ApplySwaps combinations against the gate simulator over every basis state, whole-register and sub-register, plus round trips and a superposition. The probe matters — |000> and |111> are bit-reversal symmetric and hide index errors, while a single low bit fires no rotation and hides angle errors
- FIXED: the native modular-exponentiation QPE handler required a state of exactly counting + target qubits, so QPE.execute with a ModularExponentiation unitary always failed on this backend. QPE.execute allocates before it plans, so it cannot know whether the backend will claim the intent natively and sizes for the Beauregard lowering (counting + 2n + 4) — a wider state than the handler would accept. It now takes the surplus in stride, leaving it in |0>, the same way the QFT handles a sub-register. Shor's own path was never affected because it allocates after planning
- CHANGED: the native QFT and both native QPE handlers evaluate their transform with a radix-2 FFT, O(n·2^n), instead of the direct O(4^n) sum. The index conventions derived from the gate circuit are unchanged — they were already bit-reversal permutations around a standard transform, and they still are, applied before or after the FFT — and the full column-by-column verification net (every basis state, all four Inverse x ApplySwaps configurations, whole-register and sub-register, all 16 single-qubit QPE combinations) passes unchanged. In operation counts, which are deterministic: at 12 counting qubits the transform went from 16.7M complex operations to about 49k, and at 14 the direct sum would have been 268M. In wall-clock, which on the development box varies about 2x between runs, a dense 14-counting-qubit QPE now takes ~20 s against ~9 s at 12 — a 2.2x step for four times as many output terms, which is the floor for emitting them as fusion trees at roughly a millisecond each. That per-term constant is now the whole cost; the transform no longer contributes a complexity class of its own
- NEW: cross-pair braiding on the σ-pair encoding. The fusion-tree executor refused any braid whose two anyons were not already siblings in the tree — every odd generator index on the qubit encoding — because the F-move re-association needed was implemented only for three-anyon trees. On this encoding it is one fixed structural move: the encoding fuses anyons in pairs and folds the pairs left to right into a comb, so a cross-pair braid re-associates through the comb with three F-moves until the two leaves are siblings, applies R, and re-associates back — the same F·R·F⁻¹ the three-anyon path performed, walked through the comb. Verified not against a gate simulator but against the braid group: Yang–Baxter σᵢσᵢ₊₁σᵢ = σᵢ₊₁σᵢσᵢ₊₁ for every generator on 4, 6 and 8 anyons, far commutativity including two cross-pair generators at once, and σ·σ⁻¹ = 1, on every computational basis state. These are identities the F and R data must satisfy (the pentagon and hexagon equations), so a wrong re-association cannot pass them. Trees that are neither the comb encoding nor three anyons are still refused with an explicit error. Inside the comb walk, an F-move that meets a subtree of the wrong shape, or a boundary node that does not hold exactly the leaves of the pairs it should, is likewise refused rather than silently skipped — the underlying F-move primitive returns the identity on an unrecognised shape by design, and here that would be a normalised wrong state reporting success. Ising only, since fromComputationalBasis has no Fibonacci comb encoding
- NEW: the HHL eigenvalue inversion runs natively on the fusion encoding, completing the set: every algorithm intent this backend accepts is now realised without gate compilation. The shared applyHhlInversion expresses "RY(θ_k) on the ancilla when the solution register reads |k>" as X-flips, a multi-controlled X built from H·MCZ·H and two half-rotations — a dozen gates per eigenvalue, each compiled to braids here — but the operation is diagonal in every qubit except the ancilla, so per term it is one 2x2 rotation and nothing else. Verified amplitude for amplitude against the gate simulator over every basis state of the whole register (eigenvalue qubit, solution register and ancilla), for exact, thresholded and piecewise-linear inversion: 48 columns, all agreeing. That differential replaces the two previous topological HHL tests, which asserted only that SupportsOperation said yes and that the solver returned either Ok or an error — a shape that passes whether or not the inversion is right
- NEW: the single-qubit QPE unitaries (PhaseGate, TGate, SGate, RotationZ) run natively too, so every QPE intent this backend accepts is now realised on the fusion encoding rather than compiled to braids. They are diagonal in the computational basis, so the whole controlled-U ladder collapses to one phase per counting value and the target qubit never moves. Verified against the gate simulator amplitude by amplitude across all four unitaries, both ApplySwaps settings and both PrepareTargetOne settings — the last of which is not cosmetic, since CP fires only when control AND target are 1 while CRZ merely changes sign with the target bit
- NEW: modular-exponentiation QPE runs natively here, on the fusion-tree encoding, with no gate compilation and so no Solovay-Kitaev cost. Shor's planner sees SupportsOperation accept the intent and hands it over whole, instead of falling back to the slower BraidToGate -> gate-based Shor -> GateToBraid round trip. Same fidelity class as the native Grover primitives beside it: amplitudes are transformed in the computational basis the fusion trees encode, and U_a is realised as the basis permutation it is. The period still comes out of the measured phase
- As a result `factorWithTopology` genuinely factors 15 on an Ising backend in about a tenth of a second; its test had been skipped as ">10 min" because the gate route compiled hundreds of gates through Solovay-Kitaev
- FIXED: TopologicalBackend.ExecuteToState executed nothing for circuits submitted through any wrapper other than CircuitWrapper. It fell through to an empty result, so a QAOA run against the Ising or Fibonacci backend silently reported a cut of 0 instead of failing. Unknown wrappers now return an error
- FIXED: local F-move application matched only bare Leaf subtrees, so it was a no-op on nested fusion trees. It now dispatches on the total charge of each subtree
- Requires FSharp.Azure.Quantum v1.4.10+
v0.4.9: Rebuilt against FSharp.Azure.Quantum v1.4.9
- Codebase-wide Fantomas formatting; no functional changes intended
- Requires FSharp.Azure.Quantum v1.4.9+
v0.4.8: Rebuilt against FSharp.Azure.Quantum v1.4.8 (core struct-union binary change — recompile)
- CHANGED: AnyonType, BraidGenerator, Lattice/PlanarLattice, LevinWenRegions, FaultToleranceParams and the noise-parameter records are now [<Struct>]. Source-compatible; recompile consumers
- fsharp-refactor code clean-up: ordinal string comparisons, use-bindings for disposables, narrower exception catches. No functional changes intended
- Requires FSharp.Azure.Quantum v1.4.8+
v0.4.7: BraidToGate correctness — braid→gate compilation now reproduces the exact anyonic unitaries
- FIXED: Fibonacci braid→gate compilation emits P(±3π/5), the exact RELATIVE channel phase arg(Rτ/R¹); the previous RZ(±4π/5) used the vacuum-channel (global) angle as the relative angle, so every compiled braid was off by e^{iπ/5} on the |1⟩ component. TotalPhase carries the vacuum-channel R-symbol, so TotalPhase · gates equals diag(R¹, Rτ) exactly
- FIXED: SU(2)_k braid→gate compilation computes the channel phase from the R-matrix (R[1/2,1/2;j=0], R[1/2,1/2;j=1]) instead of a flat Ising-like ±π/8 placeholder; the vacuum-channel factor is tracked in TotalPhase
- FIXED: Ising parity-pair exchange (σ at leaves 2n, 2n+1) compiles to its parity-dependent phase — a CNOT ladder computing the joint parity, S (or S† for the inverse braid), and uncompute. It was previously dropped as a "global phase", but the pair's fusion channel (Vacuum vs ψ) depends on the parity of the encoded qubits, so odd-parity terms must acquire relative phase i
- CHANGED: braidingPhase/accumulateBraidingPhase throw a descriptive error for SU2Level k < 3 (no j=1 fusion channel) instead of returning an Ising-like phase that was wrong for every k
- Requires FSharp.Azure.Quantum v1.4.7+
v0.4.6: Correctness release — full-library audit (critical + high-severity fixes)
Additional high-severity fixes in this release:
- SU(2)_k R-symbols compute the exchange eigenvalue (were the monodromy — hexagon identities now hold to machine precision; Fibonacci subcategory of SU(2)_3 reproduces the hardcoded Fibonacci values exactly)
- BraidingOperators routes all F-symbols through the pentagon-verified FMatrix module (vacuum-leg F-moves complete and unitary; two Ising sign errors and a non-unitary Fibonacci symbol fixed)
- Entanglement entropy diagonalizes the true complex Hermitian density matrix (was Re(ρ) only, and the Jacobi rotation itself was wrong even for real matrices)
- Channel-flip gates (X/Y/H/CNOT/SWAP/RX/RY) rebuild fusion-tree intermediate charges and the parity pair — post-gate states pass validateState; error correction no longer rewrites legitimate states; Fibonacci trees get τ channels (not Ising ψ)
- Kauffman bracket Planar evaluator fixed (two pre-existing bugs: dead arc endpoints inflated loop counts; state weights ignored crossing signs) — trefoil/Hopf/figure-eight now yield the true bracket polynomials and |V(-1)| = knot determinant; figureEight constructor replaced (previous diagram was not the figure-eight knot); the simplified crossing-list evaluator is documented as a curl approximation, not an invariant
- borromeanRings constructor replaced: the previous diagram was actually the (2,2,2)-pretzel link L6a5 ("chainmail" — every pair of rings linked, det 12), the opposite of the Brunnian property. Now built as the closure of the braid (σ₁σ₂⁻¹)³ and verified against the L6a4 invariants: V(t) = −t⁻³+3t⁻²−2t⁻¹+4−2t+3t²−t³, |V(−1)| = 16, writhe 0
- hopfLink rewired as the closure of the braid σ₁² (σ₁⁻² mirror): the previous wiring produced correct invariants but was a genus-1 (toroidal) embedding as diagram data; all standard constructors are now verified genus-0 planar embeddings by a new Euler-formula regression test
- measureAll clamps cumulative-probability sampling and rejects empty superpositions
v0.4.6 critical fixes (earlier batch):
- FIXED: Fusion-space dimension and basis enumeration (left-associated recursion; dim([s;s;s] -> s) was 0, now correctly 2; O(n·k²) dynamic programming instead of exponential recursion)
- FIXED: Toric-code decoder applied the wrong Pauli type per syndrome (never corrected anything); correction paths carry per-segment edge types with correct wrap-around offsets
- FIXED: Gate-to-braid compilation uses leaf indexing (qubit q = leaves 2q, 2q+1) — S/Z/Rz on qubits above 0 previously acted as identity; BraidToGate reverse compiler aligned (including the parity-pair exchange)
- FIXED: Fusion measurement uses the state's actual amplitudes (Born rule) with the correct canonical d_c/(d_a·d_b) fallback; builder measurement samples outcomes and keeps the full collapsed superposition
- FIXED: Backend executes CircuitBuilder circuits in program order (was reversed)
- FIXED: Exact amplitude-level intercepts for RZ/P (QFT/QPE phases exact — previously snapped to π/2 multiples) plus new RX/RY; intercepts now also apply to Fibonacci
- FIXED: Magic-state preparation uses valid fusion-tree intermediate charges
- CHANGED: Braid compilations that cannot be realized (H/X/Y/CZ via Ising within-pair braiding, cross-pair braids on multi-pair encodings, non-π/2 rotations) return explicit errors instead of silently wrong braid sequences; Solovay-Kitaev docs state the diagonal-only reachable set
- Requires FSharp.Azure.Quantum v1.4.6+
v0.4.3: Rebuilt against FSharp.Azure.Quantum v1.4.3
- No functional changes; keeps version in step with the core package
v0.4.2: Braid-to-gate execution
- NEW: BraidToGate.toCircuit / compileToCircuit - compile a braid word to a gate-based Circuit
- NEW: BraidToGate.executeOnGateBackend - run a topological (braid) program on any gate-based IQuantumBackend (local simulator or gate cloud) for cross-validation
- Requires FSharp.Azure.Quantum v1.3.10+
v0.4.1: Dependency updates
- UPDATED: FSharp.Core to 10.1.301
- No functional changes
v0.4.0: Majorana 2 (InAs–Pb tetron) hardware support
- NEW: DeviceProfile module with majorana1 (Al–InAs) and majorana2 (InAs–Pb) hardware profiles capturing measured physics (topological gap, Majorana splitting, parity lifetime, parent gap)
- NEW: NoiseModels.realisticTopologicalMajorana2 — parity lifetime τ_Z ≈ 22 s, poisoning ≈ 0.045 Hz, derived from the June 2026 InAs–Pb tetron result
- CHANGED: NoiseModels.realisticTopological now defaults to Majorana 2; the previous Al–InAs preset is preserved as realisticTopologicalMajorana1
- Requires FSharp.Azure.Quantum v1.3.10+
v0.3.10: Async backend integration
- NEW: TopologicalBackend now implements async IQuantumBackend members (ExecuteToStateAsync, ApplyOperationAsync)
- IMPROVED: Aligned with FSharp.Azure.Quantum v1.3.10 async API additions