Skip to content

Commit

Permalink
Merge branch 'master' into pr/425
Browse files Browse the repository at this point in the history
  • Loading branch information
Benzillaist committed Nov 14, 2024
2 parents c1bba5b + ce1dc02 commit b79e3ee
Show file tree
Hide file tree
Showing 122 changed files with 5,879 additions and 2,214 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4

# restore records from the artifacts
- uses: dawidd6/action-download-artifact@v3
- uses: dawidd6/action-download-artifact@v6
with:
workflow: benchmark.yml
name: performance-tracking
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: 'nightly'
version: '1.10'
- uses: julia-actions/julia-buildpkg@latest
- name: install dependencies
run: julia -e 'using Pkg; pkg"add PkgBenchmark [email protected]"'
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci-julia-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
include:
- os: ubuntu-latest
arch: x64
version: nightly
version: alpha
threads: 2
jet: 'false'
- os: ubuntu-latest
Expand All @@ -26,11 +26,10 @@ jobs:
jet: 'true'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/install-juliaup@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
channel: ${{ matrix.version }}~${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
branches: [master, main]
tags: ["*"]
pull_request:

concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the master branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

env:
PYTHON: ~
jobs:
Expand All @@ -23,13 +31,26 @@ jobs:
- '5'
arch:
- x64
include:
- arch: aarch64
os: macos-latest
version: '1'
threads: '1'
- arch: x64
os: macos-latest
version: '1'
threads: '1'
- arch: x64
os: windows-latest
version: '1'
threads: '1'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
Expand All @@ -47,7 +68,7 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: julia-actions/cache@v1
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/downgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
- uses: cjdoris/julia-downgrade-compat-action@v1
with:
skip: Pkg,TOML,InteractiveUtils,Random,LinearAlgebra
- uses: julia-actions/cache@v1
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
2 changes: 1 addition & 1 deletion .github/workflows/invalidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
version: '1'
- uses: actions/checkout@v4
- uses: julia-actions/cache@v1
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_pr
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ LocalPreferences.toml
*/.*swp
scratch/
*.cov
.vscode/
.vscode
test/.CondaPkg/
docs/.CondaPkg/
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[default.extend-words]
ket = "ket"
anc = "anc"

[type.ipynb]
# It detects false possitives in the base64 encoded images inside notebooks
Expand Down
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,89 @@

# News

## v0.9.14 - 2024-11-03

- **(fix)** `affectedqubits()` on `sMX`, `sMY`, and `sMR*`
- **(fix)** restrictive type-assert in `MixedDestabilizer` failing on views of tableaux
- Implementing additional named two-qubit gates: `sSQRTXX, sInvSQRTXX, sSQRTYY, sInvSQRTYY`

## v0.9.13 - 2024-10-30

- New error-correction group theory tools:
- `canonicalize_noncomm` function to find a generating set with minimal anticommutivity
- `SubsystemCodeTableau` data structure to represent the output of `canonicalize_noncomm`
- `commutify` function to find a commutative version of a non-commutative set of Paulis with minimal changes
- `matroid_parent` to, for set of Paulis that doesn't represent a state, find a version
that does.
- Implementing additional named two-qubit gates: `sSWAPCX, sInvSWAPCX, sCZSWAP, sCXSWAP, sISWAP, sInvISWAP, sSQRTZZ, sInvSQRTZZ`

## v0.9.12 - 2024-10-18

- Minor compat fixes for julia 1.11 in the handling of `hgp`

## v0.9.11 - 2024-09-27

- `hcat` of Tableaux objects
- `QuantumReedMuller` codes added to the ECC module
- **(breaking)** change the convention for how to provide a representation function in the constructor of `LPCode` -- strictly speaking a breaking change, but this is not an API that is publicly used in practice

## v0.9.10 - 2024-09-26

- The lifted product class of quantum LDPC codes is implemented in the ECC submodule.
- **(fix)** `ECC.code_s` now gives the number of parity checks with redundancy. If you want the number of linearly independent parity checks, you can use `LinearAlgebra.rank`.
- Implementing many more named single-qubit gates following naming convention similar to the stim package in python.
- **(fix)** Bug fix to the `parity_checks(ReedMuller(r, m))` of classical Reed-Muller code (it was returning generator matrix).
- `RecursiveReedMuller` code implementation as an alternative implementation of `ReedMuller`.


## v0.9.9 - 2024-08-05

- `inv` is implemented for all Clifford operator types (symbolic, dense, sparse).

## v0.9.8 - 2024-08-03

- New group-theoretical tools:
- `groupify` to generate full stabilizer group from generating set
- `minimal_generating_set` function to find the minimal generating set of a set of operators
- `pauligroup` to generate the full Pauli group of a certain number of qubits
- `normalizer` to generate all Paulis that commute with a set of Paulis
- `centralizer` to find a subset of a set of Paulis such that each element in the subset commutes with each element in the set
- `contractor` to find a subset of Paulis in a tableau that have an identity operator on a certain qubit
- `delete_columns` to remove the operators corresponding to a certain qubit from all Paulis in a Stabilizer
- `PauliError` can now encode biased noise during Pauli frame simulation, i.e. one can simulate only X errors, or only Y errors, or only Z errors, or some weighted combination of these.

## v0.9.7 - 2024-07-23

- **(fix `#320`)** Fix a serious correctness bug in the SIMD implementation of Pauli string multiplication (affects the correctness of canonicalization and traceout for tableaux bigger than ~500 qubits; does not affect symbolic gates or Pauli frame simulations of any scale)

## v0.9.6 - 2024-07-12

- `inv` implementation for single-qubit "symbolic" Clifford operators (subtypes of `AbstractSingleQubitOperator`).

## v0.9.5 - 2024-07-04

- Implementation of random all-to-all and brickwork Clifford circuits and corresponding ECC codes.

## v0.9.4 - 2024-06-28

- Addition of a constructor for concatenated quantum codes `Concat`.
- Addition of multiple unexported classical code constructors.
- Gate errors are now conveniently supported by the various ECC benchmark setups in the `ECC` module.
- Significant improvements to the low-level circuit compiler (the sumtype compactifier), leading to faster Pauli frame simulation of noisy circuits.
- Bump `QuantumOpticsBase.jl` package extension compat bound.
- **(fix)** Remove printing of spurious debug info from the PyBP decoder.
- **(fix)** Failed compactification of gates now only raises a warning instead of throwing an error. Defaults to slower non-compactified gates.

## v0.9.3 - 2024-04-10

- **(fix)** One of `random_pauli`'s methods was disregarding the error probability and had incorrect kwarg defaults.

## v0.9.2 - 2024-04-08

- The ECC module now has access to an iterative bitflip decoder thanks to `LDPCDecoders.jl`.
- Provide more configuration options in the `PyBeliefProp` decoders.
- **(fix)** The belief prop decoder from LDPCDecoders was counting iterations incorrectly.

## v0.9.1 - 2024-03-31

- Implemented `iscss` function to identify whether a given code is known to be a CSS (Calderbank-Shor-Steane) code.
Expand Down
21 changes: 12 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "QuantumClifford"
uuid = "0525e862-1e90-11e9-3e4d-1b39d7109de1"
authors = ["Stefan Krastanov <[email protected]>"]
version = "0.9.1"
authors = ["Stefan Krastanov <[email protected]> and QuantumSavory community members"]
version = "0.9.14"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand All @@ -24,6 +24,7 @@ SumTypes = "8e1ec7a9-0e02-4297-b0fe-6433085c89f2"

[weakdeps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Expand All @@ -33,6 +34,7 @@ QuantumOpticsBase = "4f57444f-1401-5e15-980d-4471b28d5678"

[extensions]
QuantumCliffordGPUExt = "CUDA"
QuantumCliffordHeckeExt = "Hecke"
QuantumCliffordLDPCDecodersExt = "LDPCDecoders"
QuantumCliffordMakieExt = "Makie"
QuantumCliffordPlotsExt = "Plots"
Expand All @@ -41,25 +43,26 @@ QuantumCliffordQOpticsExt = "QuantumOpticsBase"
QuantumCliffordQuantikzExt = "Quantikz"

[compat]
CUDA = "4.4.0"
CUDA = "4.4.0, 5"
Combinatorics = "1.0"
DataStructures = "0.18"
DocStringExtensions = "0.9"
Graphs = "1.9"
Hecke = "0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34"
HostCPUFeatures = "0.1.6"
ILog2 = "0.2.3"
ILog2 = "0.2.3, 1, 2"
InteractiveUtils = "1.9"
LDPCDecoders = "0.3"
LDPCDecoders = "0.3.1"
LinearAlgebra = "1.9"
MacroTools = "0.5.9"
Makie = "0.20"
Nemo = "0.38, 0.39, 0.40, 0.41, 0.42, 0.43"
Makie = "0.20, 0.21"
Nemo = "0.42.1, 0.43, 0.44, 0.45, 0.46, 0.47"
Plots = "1.38.0"
PrecompileTools = "1.2"
PyQDecoders = "0.2.0"
PyQDecoders = "0.2.1"
Quantikz = "1.3.1"
QuantumInterface = "0.3.3"
QuantumOpticsBase = "0.4.18"
QuantumOpticsBase = "0.4.18, 0.5"
Random = "1.9"
SIMD = "3.4.0"
SparseArrays = "1.9"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<tr>
<td>Static analysis with</td>
<td>
<a href="https://github.com/aviatesk/JET.jl"><img src="https://img.shields.io/badge/JET.jl-%E2%9C%88%EF%B8%8F-9cf" alt="JET static analysis"></a>
<a href="https://github.com/aviatesk/JET.jl"><img src="https://img.shields.io/badge/%F0%9F%9B%A9%EF%B8%8F_tested_with-JET.jl-233f9a" alt="JET static analysis"></a>
<a href="https://github.com/JuliaTesting/Aqua.jl"><img src="https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg" alt="Aqua QA"></a>
</td>
</tr>
Expand Down
21 changes: 21 additions & 0 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,25 @@ for (cs, c) in [("shor",Shor9()), ("toric8",Toric(8,8))]
end
end


if V > v"0.9.0"

function x_diag_circuit_noisy_measurement(csize)
circuit = []
for i in 1:csize
push!(circuit, PauliError(i, 0.1))
push!(circuit, sHadamard(i))
push!(circuit, sCNOT(i, csize+1))
push!(circuit, sMZ(csize+1,i))
push!(circuit, ClassicalXOR(1:(i%6+2),i))
end
return circuit
end

SUITE["circuitsim"]["compactification"] = BenchmarkGroup(["compactification"])
SUITE["circuitsim"]["compactification"]["no_compact"] = @benchmarkable pftrajectories(state,circuit) setup=(state=PauliFrame(1000, 1001, 1001); circuit=x_diag_circuit_noisy_measurement(1000)) evals=1
SUITE["circuitsim"]["compactification"]["compact"] = @benchmarkable pftrajectories(state,circuit) setup=(state=PauliFrame(1000, 1001, 1001); circuit=compactify_circuit(x_diag_circuit_noisy_measurement(1000))) evals=1

end

end
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build/
site/
.CondaPkg/
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Expand Down
8 changes: 7 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ using QuantumClifford
using QuantumClifford.Experimental.NoisyCircuits
using QuantumInterface

ENV["HECKE_PRINT_BANNER"] = "false"
import Hecke

const QuantumCliffordHeckeExt = Base.get_extension(QuantumClifford, :QuantumCliffordHeckeExt)

#DocMeta.setdocmeta!(QuantumClifford, :DocTestSetup, :(using QuantumClifford); recursive=true)

ENV["LINES"] = 80 # for forcing `displaysize(io)` to be big enough
Expand All @@ -20,8 +25,9 @@ doctest = false,
clean = true,
sitename = "QuantumClifford.jl",
format = Documenter.HTML(size_threshold_ignore = ["API.md"]),
modules = [QuantumClifford, QuantumClifford.Experimental.NoisyCircuits, QuantumClifford.ECC, QuantumInterface],
modules = [QuantumClifford, QuantumClifford.Experimental.NoisyCircuits, QuantumClifford.ECC, QuantumInterface, QuantumCliffordHeckeExt],
warnonly = [:missing_docs],
linkcheck = true,
authors = "Stefan Krastanov",
pages = [
"QuantumClifford.jl" => "index.md",
Expand Down
7 changes: 7 additions & 0 deletions docs/src/ECC_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
Modules = [QuantumClifford.ECC]
Private = false
```

## Implemented in an extension requiring `Hecke.jl`

```@autodocs
Modules = [QuantumCliffordHeckeExt]
Private = true
```
1 change: 0 additions & 1 deletion docs/src/ecc_example_sim.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ DocTestSetup = quote
using QuantumClifford
using Quantikz
end
CurrentModule = QuantumClifford.Experimental.NoisyCircuits
```

!!! warning "The documentation is incomplete"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ graphstate(ghz(4))[1]

```@eval
using Random; Random.seed!(1); using QuantumClifford, GraphMakie, CairoMakie;
f = Figure(resolution=(200,200))
f = Figure(size=(200,200))
a = Axis(f[1,1])
graphplot!(a,graphstate(ghz(4))[1])
hidedecorations!(a); hidespines!(a)
Expand Down
1 change: 0 additions & 1 deletion docs/src/noisycircuits.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ DocTestSetup = quote
using QuantumClifford
using QuantumClifford.Experimental.NoisyCircuits
end
CurrentModule = QuantumClifford.Experimental.NoisyCircuits
```

!!! warning "Unstable"
Expand Down
Loading

0 comments on commit b79e3ee

Please sign in to comment.