Skip to main content

No project description provided

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)

The API documentation is available here.

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.9.0.tar.gz (225.2 kB view details)

Uploaded Source

Built Distributions

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

qollage-0.9.0-cp313-cp313-win_amd64.whl (17.1 MB view details)

Uploaded CPython 3.13Windows x86-64

qollage-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

qollage-0.9.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (31.2 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

qollage-0.9.0-cp312-cp312-win_amd64.whl (17.1 MB view details)

Uploaded CPython 3.12Windows x86-64

qollage-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

qollage-0.9.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (31.3 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

qollage-0.9.0-cp311-cp311-win_amd64.whl (17.0 MB view details)

Uploaded CPython 3.11Windows x86-64

qollage-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

qollage-0.9.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (31.3 MB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

qollage-0.9.0-cp310-cp310-win_amd64.whl (17.0 MB view details)

Uploaded CPython 3.10Windows x86-64

qollage-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

qollage-0.9.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (31.3 MB view details)

Uploaded CPython 3.10macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: qollage-0.9.0.tar.gz
  • Upload date:
  • Size: 225.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for qollage-0.9.0.tar.gz
Algorithm Hash digest
SHA256 55d253ca2fea3e715d386fadf0fca8fe33d3172c4541271246237732db6a182d
MD5 63e62478f4e00bf0123bade7e2ca2840
BLAKE2b-256 8100ac969b144d38a010922716fd7bac28db0fd57c0238aff7a38d5cfd5c3e14

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: qollage-0.9.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 17.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for qollage-0.9.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 558ab44d2ae822e87feafe4e100148dbf52ffb3383d094ca899e7847a86f8124
MD5 9d4ce327f9d75d4d767f1e0719105f63
BLAKE2b-256 ef62b55ed4924650378064b486980881c6e753e2f7f3baed6bf794245040e039

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d332c706f3063c56e5a3fad51e777cdab61b5861cf938f9a08862deb0e791d7f
MD5 b4d1c91bfc84893a16c778ce33894401
BLAKE2b-256 c7ca87386f7037d0b9421beadbd55f7b74966cb6b22eb265edbb7f5ffa80bc1b

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 c6ce49d804f0f29be93667555144527690418d405f687c594d15a25c06e4ae88
MD5 ad49befc8df54388b40ede52e5c34ea7
BLAKE2b-256 6bbbffef584c37dbcac047385d74c224f1ef0acf53d68935a9a745c39085c13c

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: qollage-0.9.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 17.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for qollage-0.9.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 248f70e2fc2a4e328ab6df2998bf3db9d02c718d24bf034a63ff44c8bf38e024
MD5 bf8ae1837bcf6976d16d301b48de2ed2
BLAKE2b-256 f7758175908098e2ad9b9aee187f7999f80009502e2e58aea688b381b237f100

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6062c809abdba966856188d88dd8f55f975b9004725bc7e5322af6e31bc6acd4
MD5 c48f2d1d7e3d1cd37294cf9e44c087b6
BLAKE2b-256 17434f1e813616e5726ff65057aea3ba8f563c63ff8fa1b9e05bfc8ed30cf881

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 ac3f0431e7542ce680c370b4b425efd680617a778123b4d5f0caa030c4e6af65
MD5 5393ccbfa4e831630b107155057c9a90
BLAKE2b-256 80a18b396ddb0092ab6b35b7eb72bc8be1cf048b0c46526fdbca0202064b1b6e

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: qollage-0.9.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 17.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for qollage-0.9.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1a7f28ca7c5014099fbd941b2ff4a4bd2c93b2c1794fa6c0fa7bfc7548e836bd
MD5 6ce2b7e6e3f984631cb26c5e14a905b3
BLAKE2b-256 bc363df19518077a6f2f14613e478be8a0a8f327ca853c4e2b087d7438b9195b

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2ccd867b96af34a558bcc90a9171207ac49d4dca3192b7ea3ed7f6a70cedfbc
MD5 12e2365d3fbd20c8a00f3792539721fb
BLAKE2b-256 1f10cf24dec7264306676fcad6a61ad37f37296968cd09338d0f4e54cd065733

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 86227b440b9f308c4b7fd5729659710fd44fef50de7b57ff4b54f198ba9d86f7
MD5 7dfde67ec7156799ab3dac74d73cf861
BLAKE2b-256 e323ad11e5f3717f7fc1566b9da482c21048b9506b873e4385650f84172c3cd0

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: qollage-0.9.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 17.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for qollage-0.9.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1caebcc6b995ae56e27447142e01a6ad018d1be0f8399539fa23399701d0edba
MD5 dbd40edec1a2cfd8e3c3426b3a931e24
BLAKE2b-256 7943acf6139733ed41882f847d991a82c1cd9f2e402f30a8496fee8c50156568

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4612af3b81a2b3bfe040637794c833d55ca9fd37a3a5b28858bf106eef0f636
MD5 7635ef58bf1b601b3ef185ad2f32991a
BLAKE2b-256 2967d7bea740c1c8283005bc754da0614d66e581a1608443f19c5abe58456d69

See more details on using hashes here.

File details

Details for the file qollage-0.9.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qollage-0.9.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 46306c523eb683a829549b7ed02d085e2b8729ee57569b609d379abe774e4d28
MD5 e45ac9ddc6656fa81f0d1cf6df5bef2a
BLAKE2b-256 ca546ac180ac76c4dc8a590569243396751f98222d459ec89aa6e6732de95e13

See more details on using hashes here.

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