-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathCargo.toml
More file actions
303 lines (271 loc) · 10.4 KB
/
Copy pathCargo.toml
File metadata and controls
303 lines (271 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
[workspace]
resolver = "2"
members = [
"python/pecos-rslib",
"python/pecos-rslib-exp",
"python/pecos-rslib-cuda",
"python/pecos-rslib-llvm",
"python/selene-plugins/pecos-selene-mast",
"python/selene-plugins/pecos-selene-stab-mps",
"python/selene-plugins/pecos-selene-stab-vec",
"python/selene-plugins/pecos-selene-stabilizer",
"python/selene-plugins/pecos-selene-statevec",
"julia/pecos-julia-ffi",
"go/pecos-go-ffi",
"crates/pecos*",
"crates/benchmarks",
"exp/pecos*",
"exp/zlup",
"exp/guppy-zlup",
"exp/zluppy",
]
[workspace.package]
version = "0.2.0-dev.0"
edition = "2024"
readme = "README.md"
authors = ["The PECOS Developers", "Ciaran Ryan-Anderson <ciaranra@gmail.com>"]
homepage = "https://pecos.io"
repository = "https://github.com/PECOS-packages/PECOS"
license = "Apache-2.0"
keywords = [
"quantum",
"QEC",
"error-correction",
"simulation",
"quantum-computing",
]
categories = ["science", "simulation"]
[workspace.dependencies]
# --- Serialization & config ---
serde = { version = "1", features = ["derive"] }
serde_json = "1"
ron = "0.12"
toml = "1"
toml_edit = "0.25"
# --- CLI ---
clap = { version = "4", features = ["derive"] }
clap_complete = "4.5"
cargo_metadata = "0.23"
# --- Python bindings ---
# Note: `extension-module`/`abi3-py310`/`generate-import-lib` are intentionally
# NOT enabled at the workspace level. They tell pyo3 to skip linking libpython
# at build time, which is what we want when maturin builds the cdylib but is
# fatal for plain `cargo test`. Each pecos-rslib* crate gates them behind its
# own `extension-module` feature; maturin opts in via pyproject.toml.
pyo3 = "0.29"
# --- C/C++ FFI & build ---
bindgen = "0.72"
cc = "1"
cxx = "1"
cxx-build = "1"
libc = "0.2"
libloading = "0.9"
# --- LLVM ---
inkwell = { version = "0.9", features = ["llvm21-1-prefer-dynamic"] }
# --- HUGR / tket ---
tket = { version = "0.19", default-features = false }
tket-qsystem = { version = "0.25", default-features = false }
# --- WebAssembly ---
wasmtime = { version = "46", default-features = false, features = [
"cranelift",
"runtime",
"wat",
"std",
] }
wat = "1"
# --- Parsing ---
pest = "2"
pest_derive = "2"
regex = "1"
# --- Numerical computing ---
libm = "0.2"
nalgebra = "0.35"
num = "0.4"
# Dev-only differential oracle for special-function tests (see design/jeffreys-pecos-num.md)
puruspe = "0.4"
num-complex = "0.4"
num-traits = "0.2"
num-bigint = { version = "0.4", features = ["serde"] }
ndarray = "0.17"
wide = "1"
# --- RNG ---
fastrand = "2"
rand = "0.10"
rand_core = "0.10"
rand_xoshiro = "0.8"
rapidrand = { version = "0.1", features = ["rand"] }
# --- Data structures ---
bitflags = "2"
bitvec = { version = "1", features = ["serde"] }
bytemuck = { version = "1", features = ["derive"] }
dyn-clone = "1"
smallvec = "1"
# --- Concurrency ---
crossbeam-channel = "0.5"
parking_lot = "0.12"
rayon = "1"
# --- GPU ---
wgpu = "29"
pollster = "0.4"
# --- Graph algorithms ---
petgraph = "0.8"
rustworkx-core = "0.18"
# --- Networking & archive handling ---
# Use rustls WITHOUT its default aws-lc-rs crypto provider: aws-lc-sys ships
# hand-written assembly whose .eh_frame rustc's bundled rust-lld mis-links
# ("invalid CIE reference"), breaking build-script links on some toolchains.
# We install the `ring` provider at runtime instead (see pecos-build download).
reqwest = { version = "0.13", default-features = false, features = [
"blocking",
"rustls-no-provider",
] }
rustls = { version = "0.23", default-features = false, features = [
"ring",
"std",
"tls12",
] }
flate2 = "1"
sha2 = "0.11"
tar = "0.4"
xz2 = "0.1"
bzip2 = "0.6"
sevenz-rust = "0.6"
zip = { version = "8", default-features = false, features = ["deflate"] }
zstd = "0.13"
# --- Logging ---
log = "0.4"
env_logger = "0.11"
# --- Error handling ---
anyhow = "1"
thiserror = "2"
# --- Filesystem ---
dirs = "6"
tempfile = "3"
# --- Testing ---
approx = "0.5"
assert_cmd = "2"
criterion = "0.8"
paste = "1"
random_tester = "0.1"
proptest = "1"
# --- ZX calculus ---
quizx = "0.3"
# --- Decoder libraries ---
fusion-blossom = "0.2"
mwpf = { git = "https://github.com/yuewuo/mwpf", rev = "b8444428f999457208c4b0956f3f1c745a0ec2d5", default-features = false, features = [
"f64_weight",
] }
relay-bp = "0.2"
# ndarray 0.16 for relay-bp compat (relay-bp uses ndarray 0.16, PECOS uses 0.17)
ndarray-016 = { package = "ndarray", version = "0.16" }
# sprs pinned to 0.11.3 for ndarray 0.16 compat with relay-bp
sprs = "=0.11.3"
# =============================================================================
# Internal crates (alphabetical)
# =============================================================================
pecos = { version = "0.2.0-dev.0", path = "crates/pecos", default-features = false }
pecos-build = { version = "0.2.0-dev.0", path = "crates/pecos-build", default-features = false }
pecos-chromobius = { version = "0.2.0-dev.0", path = "crates/pecos-chromobius" }
pecos-core = { version = "0.2.0-dev.0", path = "crates/pecos-core" }
pecos-cppsparsestab = { version = "0.2.0-dev.0", path = "crates/pecos-cppsparsestab" }
pecos-cuquantum = { version = "0.2.0-dev.0", path = "crates/pecos-cuquantum" }
pecos-cuquantum-sys = { version = "0.2.0-dev.0", path = "crates/pecos-cuquantum-sys" }
pecos-decoder-core = { version = "0.2.0-dev.0", path = "crates/pecos-decoder-core" }
pecos-decoders = { version = "0.2.0-dev.0", path = "crates/pecos-decoders" }
pecos-engines = { version = "0.2.0-dev.0", path = "crates/pecos-engines" }
pecos-eeg = { version = "0.2.0-dev.0", path = "exp/pecos-eeg" }
pecos-stab-tn = { version = "0.2.0-dev.0", path = "exp/pecos-stab-tn" }
pecos-experimental = { version = "0.2.0-dev.0", path = "exp/pecos-experimental" }
pecos-foreign = { version = "0.2.0-dev.0", path = "crates/pecos-foreign" }
pecos-fusion-blossom = { version = "0.2.0-dev.0", path = "crates/pecos-fusion-blossom" }
pecos-gpu-sims = { version = "0.2.0-dev.0", path = "crates/pecos-gpu-sims" }
pecos-hugr = { version = "0.2.0-dev.0", path = "crates/pecos-hugr" }
pecos-hugr-qis = { version = "0.2.0-dev.0", path = "crates/pecos-hugr-qis" }
pecos-ldpc-decoders = { version = "0.2.0-dev.0", path = "crates/pecos-ldpc-decoders" }
pecos-lindblad = { version = "0.2.0-dev.0", path = "exp/pecos-lindblad" }
pecos-llvm = { version = "0.2.0-dev.0", path = "crates/pecos-llvm" }
pecos-mwpf = { version = "0.2.0-dev.0", path = "crates/pecos-mwpf" }
pecos-neo = { version = "0.2.0-dev.0", path = "exp/pecos-neo" }
pecos-num = { version = "0.2.0-dev.0", path = "crates/pecos-num" }
pecos-phir = { version = "0.2.0-dev.0", path = "crates/pecos-phir" }
pecos-phir-json = { version = "0.2.0-dev.0", path = "crates/pecos-phir-json" }
pecos-programs = { version = "0.2.0-dev.0", path = "crates/pecos-programs" }
pecos-pymatching = { version = "0.2.0-dev.0", path = "crates/pecos-pymatching" }
pecos-qasm = { version = "0.2.0-dev.0", path = "crates/pecos-qasm" }
pecos-qec = { version = "0.2.0-dev.0", path = "crates/pecos-qec" }
pecos-qis = { version = "0.2.0-dev.0", path = "crates/pecos-qis" }
pecos-qis-ffi = { version = "0.2.0-dev.0", path = "crates/pecos-qis-ffi" }
pecos-qis-ffi-types = { version = "0.2.0-dev.0", path = "crates/pecos-qis-ffi-types" }
pecos-quantum = { version = "0.2.0-dev.0", path = "crates/pecos-quantum" }
pecos-random = { version = "0.2.0-dev.0", path = "crates/pecos-random" }
pecos-relay-bp = { version = "0.2.0-dev.0", path = "crates/pecos-relay-bp" }
pecos-results = { version = "0.2.0-dev.0", path = "crates/pecos-results" }
pecos-rslib = { version = "0.2.0-dev.0", path = "python/pecos-rslib" }
pecos-rslib-llvm = { version = "0.2.0-dev.0", path = "python/pecos-rslib-llvm" }
pecos-simulators = { version = "0.2.0-dev.0", path = "crates/pecos-simulators" }
pecos-tesseract = { version = "0.2.0-dev.0", path = "crates/pecos-tesseract" }
pecos-uf-decoder = { version = "0.2.0-dev.0", path = "crates/pecos-uf-decoder" }
pecos-wasm = { version = "0.2.0-dev.0", path = "crates/pecos-wasm" }
pecos-zx = { version = "0.2.0-dev.0", path = "exp/pecos-zx" }
# Faster linking on supported platforms (everything else is cargo's default)
[profile.dev]
split-debuginfo = "unpacked"
[profile.test]
split-debuginfo = "unpacked"
# The release profile
[profile.release]
opt-level = 3 # Maximum optimization
lto = true # Link-time optimization (same as "fat")
codegen-units = 1 # Single codegen unit for better optimization
strip = true # Strip debug symbols for smaller binaries
# Profiling profile: release optimizations but keeps debug info for perf/samply.
# Use with: cargo build --profile profiling
# Or: maturin develop --profile profiling
[profile.profiling]
inherits = "release"
strip = false
debug = 1 # line tables only — minimal size impact
# Native profile: release + CPU-specific optimizations.
# Use with: cargo build --profile native (or just <recipe> native).
# Build scripts detect this via PROFILE=native env var and add --march=native for C++ code.
# Rust code gets -C target-cpu=native via RUSTFLAGS supplied by the caller (Justfile
# recipes, pecos python build --profile native, etc.). Setting it here as
# `profile.native.rustflags` would be cleaner but that field is still unstable in
# stable cargo as of 1.93.
[profile.native]
inherits = "release"
[workspace.lints.clippy]
suspicious = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
style = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
# Dependency version conflicts we can't control
multiple-crate-versions = "allow"
# Physics/math code uses short, domain-standard variable names (sx/sz, x/z/r/s/p)
similar-names = "allow"
many-single-char-names = "allow"
too-many-lines = "allow" # ~114 hits across 11 crates -- sim algorithms, tests, benchmarks
# Simulation-heavy crates run at opt-level 2 even in dev/test builds:
# statistical validation tests (e.g. the surface-code LER equivalence
# gate) need tens of thousands of simulated shots and are unusably slow
# unoptimized (>10 min vs ~2 min). Debug assertions remain enabled.
[profile.dev.package.pecos-core]
opt-level = 2
[profile.dev.package.pecos-random]
opt-level = 2
[profile.dev.package.pecos-simulators]
opt-level = 2
[profile.dev.package.pecos-engines]
opt-level = 2
[profile.dev.package.pecos-neo]
opt-level = 2
[profile.dev.package.pecos-qasm]
opt-level = 2
[profile.dev.package.pecos-qec]
opt-level = 2
[profile.dev.package.pecos-fusion-blossom]
opt-level = 2
[profile.dev.package.fusion-blossom]
opt-level = 2