Skip to main content

Domcsi's Epic Tinker Box - a collection of Python utilities for scientific and quantum computing research.

Project description

Python pytest PyPI version python mypy Python Ruff


Julia tests Julia version Julia format Julia docs Julia LoC metrics

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ᴺ

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: 293 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: 1807 LOC, code share = 71.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

domcsis_epic_tinker_box-0.4.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

domcsis_epic_tinker_box-0.4.2-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file domcsis_epic_tinker_box-0.4.2.tar.gz.

File metadata

  • Download URL: domcsis_epic_tinker_box-0.4.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for domcsis_epic_tinker_box-0.4.2.tar.gz
Algorithm Hash digest
SHA256 c0cca6becbf8b5602d923c7a7591de84bf5928daaaa803ab93469416c5209be3
MD5 e97c9f9852b897c1dc49ba1adab7e200
BLAKE2b-256 dee304f5e92a966909bc827ec3302a3e662a8a56aa09a1dc1f10bcbd14dad522

See more details on using hashes here.

Provenance

The following attestation bundles were made for domcsis_epic_tinker_box-0.4.2.tar.gz:

Publisher: python-publish.yml on szmbthydmnk/domcsis-epic-tinker-box

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file domcsis_epic_tinker_box-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for domcsis_epic_tinker_box-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8640fee6c1ecdcce9e8f51191e070a57dae9f86d8803c9e143832c63c53e9a2
MD5 b2abf2e6e74cc4e80feff3a693f19200
BLAKE2b-256 fe5caca9a2b6887895f9cbee4b580b44fed6163c3725890c86300ad0cc74ddca

See more details on using hashes here.

Provenance

The following attestation bundles were made for domcsis_epic_tinker_box-0.4.2-py3-none-any.whl:

Publisher: python-publish.yml on szmbthydmnk/domcsis-epic-tinker-box

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page