Skip to content
/ QCLight Public

Simple and lightweight Quantum Computing simulator built with python3 for educational purposes

License

Notifications You must be signed in to change notification settings

TendTo/QCLight

Repository files navigation

Simple and lightweight Quantum Computing simulator built with python3 for educational purposes.


Deploy CI

🐍 Installation

pip install qclight

Example

"""Main"""
from qclight.circuit import QCLVisualCircuit


def main():
    """Simple main function"""
    circuit = QCLVisualCircuit(4)
    circuit.h(0)
    circuit.cx(0, 3)
    circuit.barrier()
    circuit.x(2)
    print(circuit)


if __name__ == "__main__":
    main()

💻 Local development

🧾 Requirements

🔧 Setup

Install the package locally with pip

ℹ️ You may want to use a virtual local environment to install all your dependencies in. There are many options, but the simplest one is creating a venv environment with python3 -m venv .venv. Make sure to activate the environment with source .venv/bin/activate. If you are on Windows or want more information, follow this guide.

# install the package requirements
pip3 install -r requirements.txt
# install the qclight package locally
pip3 install -e .

⚠️ Some older versions of pip do not support the -e [--editable] flag. The package can still be installed locally, but any change made to it requires a new installation to be properly visible.

🧪 Tests

Make sure to follow the setup section beforehand.

# install development requirements
pip3 install -r requirements_dev.txt
# run the linter
pylint src/qclight
# run the tests
pytest

TODO

  • Improve performance with a custom range function for fixed bits
  • Measure qubit
  • Add more examples
  • Print ascii of circuit
  • Print svg of circuit
  • Circuit composition
  • Circuit to gate
  • SumCircuit

About

Simple and lightweight Quantum Computing simulator built with python3 for educational purposes

Topics

Resources

License

Stars

Watchers

Forks

Languages