Domcsi's Epic Tinker Box - a collection of Python utilities for scientific and quantum computing research.
Project description
Domcsi's Epic Tinker Box
Hello stranger!
Domcsi's Epic Tinker Box is my little repository of Python and Julia libraries filled (gradually) with code and routines that I use throughout my coding, scientific and research journey.
This is also a playground for myself to learn and grow as a programmer.
Table of contents:
Implemented Features
statistics
| Function | Description | Python | Julia |
|---|---|---|---|
mean |
Arithmetic mean of a numeric vector | ✅ | ✅ |
mean_complex |
Population mean of complex samples; returns (real_part, complex_mean) |
✅ | ❌ |
variance |
Population variance (N denominator) | ✅ | ❌ |
skewness |
Pearson's moment coefficient of skewness | ✅ | ❌ |
generate_gaussian_rnd_numbers |
Samples from 𝒩(μ, σ²) | ✅ | ❌ |
generate_uniform_rnd_numbers |
Samples from Uniform(a, b) | ✅ | ❌ |
generate_exponential_rnd_numbers |
Samples from Exp(λ) | ✅ | ❌ |
generate_wigner_surmise_rnd_numbers |
Samples from the generalised Wigner surmise (GOE/GUE/GSE and beyond) | ✅ | ❌ |
generate_random_numbers |
Unified dispatch wrapper for all distributions | ✅ | ❌ |
All Python samplers support optional rng injection or seed for reproducible, non-global-state sampling.
pauli_algebra
| Function / Class | Description | Python | Julia |
|---|---|---|---|
pauli_matrix(which) |
Single-qubit Pauli matrix in sparse CSR format | ✅ | ❌ |
generate_all_pauli_strings(n) |
All 4ⁿ Pauli strings for n qubits in lexicographic order | ✅ | ❌ |
generate_pauli_operators(n) |
All 4ⁿ sparse Pauli matrices | ✅ | ❌ |
PauliOperators |
Immutable validated collection with factories all(n) and from_strings(set) |
✅ | ❌ |
quantum_state
| Constructor | Description | Python | Julia |
|---|---|---|---|
QuantumState.from_vector(ψ) |
Pure state from state vector (2ᴺ,) |
✅ | ❌ |
QuantumState.from_density_matrix(ρ) |
State from density matrix (2ᴺ, 2ᴺ) |
✅ | ❌ |
QuantumState.from_vectorized_density_matrix(ρ_vec) |
State from vec(ρ) (4ᴺ,) |
✅ | ❌ |
Derived quantities computed on demand:
| Property | Returns | Python | Julia |
|---|---|---|---|
.vector |
State vector; raises for mixed states | ✅ | ❌ |
.density_matrix |
ρ = |ψ⟩⟨ψ| or stored ρ | ✅ | ❌ |
.purity |
Tr(ρ²) | ✅ | ❌ |
.dim |
Hilbert space dimension 2ᴺ | ✅ | ❌ |
| Function | Description | Python | Julia |
|---|---|---|---|
bell_state |
Generate general Bell-states | ✅ | ❌ |
w_state |
Generate general w-states | ✅ | ❌ |
bell_state |
Generate general Bell-states | ✅ | ❌ |
generate_all_stabilizer_states |
- | ❌ | ❌ |
generate_random_stabilizer_state |
- | ❌ | ❌ |
magic
| Function | Description | Python | Julia |
|---|---|---|---|
stabilizer_renyi_entropy(state, paulis, α) |
α-Stabilizer Rényi Entropy M_α | ✅ | ❌ |
_stabilizer_renyi_entropy_unchecked(...) |
Fast path for hot loops | ✅ | ❌ |
characteristic_function(ψ, paulis) |
Ξ(P) = |⟨ψ|P|ψ⟩|² / 2ⁿ for all P | ✅ | ❌ |
validate_alpha(α) |
Standalone α validator | ✅ | ❌ |
validate_compatible(state, paulis) |
Checks n_qubits agreement | ✅ | ❌ |
Metrics
Number of Tests
- Python tests: 344 tests
- Julia tests: 6 tests
LOC metrics
Now this is not important, and I do not think that it is a good idea to attribute quality, effort or productiveness to the following metric, but it is like the first, easy-peasy GitHub Action that one can set up, so here it is:
LOC is lines of code
LOCo is lines of comments
code share is LOC/(LOC + LOCo)
- Python: 2613 LOC, code share = 65.7%
- Julia: 36 LOC, code share = 97.3%
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file domcsis_epic_tinker_box-0.5.1.tar.gz.
File metadata
- Download URL: domcsis_epic_tinker_box-0.5.1.tar.gz
- Upload date:
- Size: 31.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
805e8af52ecc8b1ef50aa88eaf0f256c0130816d246633643cdb07366ebc4abe
|
|
| MD5 |
65f896740f0aa7d6198fd99f784f1adc
|
|
| BLAKE2b-256 |
6c7e5ad8dfb1baf348f6dae5b57ba749d2cc1f9e7c30d176b3dcc80612169265
|
Provenance
The following attestation bundles were made for domcsis_epic_tinker_box-0.5.1.tar.gz:
Publisher:
python-publish.yml on szmbthydmnk/domcsis-epic-tinker-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
domcsis_epic_tinker_box-0.5.1.tar.gz -
Subject digest:
805e8af52ecc8b1ef50aa88eaf0f256c0130816d246633643cdb07366ebc4abe - Sigstore transparency entry: 1656631781
- Sigstore integration time:
-
Permalink:
szmbthydmnk/domcsis-epic-tinker-box@ed16d9f7d16ce19037a4b987e0b58b943146b002 -
Branch / Tag:
refs/tags/python-v0.5.1 - Owner: https://github.com/szmbthydmnk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ed16d9f7d16ce19037a4b987e0b58b943146b002 -
Trigger Event:
release
-
Statement type:
File details
Details for the file domcsis_epic_tinker_box-0.5.1-py3-none-any.whl.
File metadata
- Download URL: domcsis_epic_tinker_box-0.5.1-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbbc94b28d2408dc399cacf20e66f7814d596a92ef29758cd5bedbddb457b17c
|
|
| MD5 |
8c0b7b63ba7e79c1087c6d8241ccdcf5
|
|
| BLAKE2b-256 |
1ae163e11a1e66b86aaeb30873ff5b518da9a8e4dbd69e7353cb52bf60dec5d2
|
Provenance
The following attestation bundles were made for domcsis_epic_tinker_box-0.5.1-py3-none-any.whl:
Publisher:
python-publish.yml on szmbthydmnk/domcsis-epic-tinker-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
domcsis_epic_tinker_box-0.5.1-py3-none-any.whl -
Subject digest:
cbbc94b28d2408dc399cacf20e66f7814d596a92ef29758cd5bedbddb457b17c - Sigstore transparency entry: 1656631878
- Sigstore integration time:
-
Permalink:
szmbthydmnk/domcsis-epic-tinker-box@ed16d9f7d16ce19037a4b987e0b58b943146b002 -
Branch / Tag:
refs/tags/python-v0.5.1 - Owner: https://github.com/szmbthydmnk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ed16d9f7d16ce19037a4b987e0b58b943146b002 -
Trigger Event:
release
-
Statement type: