Skip to main content

Visualization tool for qoqo quantum computing toolkit by HQS Quantum Simulations

Project description

qollage

Documentation Status GitHub Workflow Status PyPI PyPI - Format Crates.io

Drawing tool for the qoqo quantum toolkit by HQS Quantum Simulations.

Qollage provides the save_circuit and draw_circuit functions that allows users to translate a qoqo circuit into a png image and either save it or display it.
These two functions will create a cache folder named .qollage containing fonts and Typst libraries in the current directory. You are free to delete it but the files will be downloaded again at the next use.
It also provides the circuit_to_typst_str that can be used to generate a string that can be copy pasted in the Typst interpreter if you want to edit the circuit further.
The latest qoqo gates might not be implemented in qollage yet. A circuit containing not supported operations can't be drawn and will result in an error.
If a gate has a string parameter it will be printed inside a typst mathematical expression and the typst symbols will be replaced.
Alphanumerical expressions will be preprocessed, if it doesn't represent any typst symbol it will be escaped by surrounding quotes.
qoqo.operations.RotateX(0, "theta") will be formatted as θ.
qoqo.operations.RotateX(0, "param") will be escaped with quotes and kept as it is.
qoqo.operations.RotateX(0, "\"param\"") will not be accepted because the extra quotes will interfere with the quotes added to escape param.
For more informations see the documentation.
Here is the list of symbols but be aware that not all of them are supported by the font used.

Example:

In a jupyter cell:

from qoqo import Circuit, operations as ops
from qollage import draw_circuit

circuit = Circuit()
circuit += ops.DefinitionBit("ro", 2, True)
circuit += ops.Hadamard(0)
circuit += ops.CNOT(0, 1)
circuit += ops.PauliX(1)
circuit += ops.RotateX(0, "theta")
circuit += ops.MeasureQubit(0, "ro", 0)
circuit += ops.MeasureQubit(1, "ro", 1)

draw_circuit(circuit)

General Notes

This software is still in the beta stage. Functions and documentation are not yet complete and breaking changes can occur.

Contributing

We welcome contributions to the project. If you want to contribute code, please have a look at CONTRIBUTE.md for our code contribution guidelines.

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

qollage-0.2.0.tar.gz (196.7 kB view details)

Uploaded Source

Built Distributions

qollage-0.2.0-cp312-none-win_amd64.whl (15.1 MB view details)

Uploaded CPython 3.12 Windows x86-64

qollage-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

qollage-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl (14.2 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

qollage-0.2.0-cp311-none-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.11 Windows x86-64

qollage-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

qollage-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl (14.2 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

qollage-0.2.0-cp310-none-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.10 Windows x86-64

qollage-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

qollage-0.2.0-cp310-cp310-macosx_10_12_x86_64.whl (14.2 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

qollage-0.2.0-cp39-none-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.9 Windows x86-64

qollage-0.2.0-cp39-cp39-macosx_11_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

qollage-0.2.0-cp39-cp39-macosx_10_12_x86_64.whl (14.2 MB view details)

Uploaded CPython 3.9 macOS 10.12+ x86-64

qollage-0.2.0-cp38-none-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.8 Windows x86-64

qollage-0.2.0-cp38-cp38-macosx_11_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

qollage-0.2.0-cp38-cp38-macosx_10_12_x86_64.whl (14.2 MB view details)

Uploaded CPython 3.8 macOS 10.12+ x86-64

File details

Details for the file qollage-0.2.0.tar.gz.

File metadata

  • Download URL: qollage-0.2.0.tar.gz
  • Upload date:
  • Size: 196.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.2.0.tar.gz
Algorithm Hash digest
SHA256 84ea0f278dd2d3b40dafe07e2306b8a67bda565400fe5c393e7d3d0a6a8be5cf
MD5 cc2f21225555b9a7563e3a2c4ca1dda1
BLAKE2b-256 f8c62ff82234287a926f66efa8006b060b8ac9db3cfcb7400544b0067ba67f10

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp312-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.2.0-cp312-none-win_amd64.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.2.0-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 70d7f399b264037ed58ef1f2694d7112a924695b23126e547fff5183a8419314
MD5 93db5789fc54e8e98bd899223ddf6319
BLAKE2b-256 7772e34b0304b0a80808c949fd81d3ac51160d12fd16efe3a454c0a8f507eaca

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 66c1bc878697fb21ec277c068234740936a1608eb8b000366082137c231c8fa6
MD5 144183a4d6074edfc194455ee66b30f3
BLAKE2b-256 58823f9f8c85c79babe293fe7e93795ce4d32e0a1d89ba5b276245350191633e

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 89a8860a176dffd5c6f045ac56a0b8961e3ea4c91d6d6efde45fc30f38939bee
MD5 6a3db00371af3bd77e30ff35e30f56ba
BLAKE2b-256 1eb41d083e23a9a53e97ea3d15c4c815feff530b2db557b30d20cfd8c09935cd

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp311-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.2.0-cp311-none-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.2.0-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 2d645b4e1e0d3430bcd90703e6f05b953fa9c28a3837d9a4fbc81b4e6e6c1d33
MD5 23a68b15352bc5434e11bd7b1b25d226
BLAKE2b-256 713cf6ee7922f7ea30a17d7bc2d3857a0e4cfafa8cd087f6763c05642ed25ef0

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb4265b46c10f4a258f7f5e832afc3945d284c05d75260b4f6f891b7f904387c
MD5 98c843b75b0e2eb84f4c5429037870ec
BLAKE2b-256 57e0b318a7d9994836e10913ad5b5e682540f6055320e2ab77a26f307d80f8a6

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 22e82b3fa13ec3e2480f06c988ebeb22ca212912c1431aff63b829147048c934
MD5 aeed551d226bc988c8ee5395ab1897da
BLAKE2b-256 f6fa48e92f5102e09568f6109ecef7e27384a9fc81783416e8228d5ad2fec06a

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp310-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.2.0-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.2.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 3d3faa012c27d5be27b3392a96bce760deb690039e0ed7504e936cca8511cc7e
MD5 43e87c0ce60fa7d5fd2b688d423b0761
BLAKE2b-256 f6a854257a72e01544d5bd90d441644ddb5d88739847fc05806d6a9b96c20b1a

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 deffb48ef68f7caa117b77500675743768c4ad5e4cf3cc8d8a743ad9170646b2
MD5 f90e6b4b87ac9db49f1cd940a0a0a156
BLAKE2b-256 b259f4ca2c79083f19006ea64caa148cc264ab29280eed98607d57e150e5e94a

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b5e30330720705f039bd0dab6f2f7ebb21487fb43b3e50a1bb4da536d4489c38
MD5 1ad2b6740e3e59edd2c419658c4a81ef
BLAKE2b-256 ccf58f49a780d08b6571d7b4ff48c6e9c0abe38f733714823f5000c9a723059e

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp39-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.2.0-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.2.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 b09791af4169667b3e907ce483a6d03e62dbfcdc82a8821a78899288f1b72414
MD5 c025181710436cfe0ce25b658ffe76cb
BLAKE2b-256 7d0d3b5ddb115d2ea00b59b19c0fa942086dd14c5f9a732c78ffa96d6dd6797c

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b2bbdecc5a4275abfd6da367df5a25c707975e6d8ba9b1bf335f9da16e5ff3d1
MD5 63a296155bc9d128f73dda61b4f46ec2
BLAKE2b-256 458d1c3637e5068031e3f9a24846658e11ab2dd90bafcc9d565bdaf0df02b40c

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4546393ec098d7d1d48e357a729b04f0c94350b987a50e8577c0349d51062e63
MD5 a917338c995016afe3314f0f250f1b7d
BLAKE2b-256 721f160a7d36141326afd4da4dfcc1b34964952d1ba509d04376286c7785dbd5

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp38-none-win_amd64.whl.

File metadata

  • Download URL: qollage-0.2.0-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qollage-0.2.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 d7f940fd2ce25f81c6c1cf1ae352d4730604a8872c2d4d042228b10ba97ad649
MD5 84cb5ebe5723ec3573fb9ea5a51ab041
BLAKE2b-256 17782e3845c97fbbe957983c5028333146891e2996cb49babdb2df51a3c15905

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 194f4e75465d35fef9b6cd342940af592eca42cbfd946845f42a0994e632bb79
MD5 48cb4d0ee66228c632c040e2e090e660
BLAKE2b-256 dd13c3c58075ab04961188d2fe641a7cb454484d8a000bb7b0925832ca8683d0

See more details on using hashes here.

File details

Details for the file qollage-0.2.0-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.2.0-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 22376fc169ad45567585590ee05f5586503e22d8272be4fdd106e27e7abb976f
MD5 cac3377add6e083f19576fb891b873af
BLAKE2b-256 bc80d5086f5d4ff4ea5cc339e118100ea91b554a2b659a29940d0ce5ca9b86f8

See more details on using hashes here.

Supported by

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