tqsim
TQSim is an open-source anyon-based Topological Quantum Computing simulator
Science Score: 31.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.0%) to scientific vocabulary
Scientific Fields
Repository
TQSim is an open-source anyon-based Topological Quantum Computing simulator
Basic Info
Statistics
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 13
- Releases: 0
Metadata Files
README.md
TQSim
TQSim stands for Topological Quantum Simulator. It is an open-source library developed by CQTech for simulating topological quantum computers based on Fibonacci anyons.
Documentation for the latest stable version of TQSim is available here.
Installation
You can install TQSim from pip using
bash
pip install --upgrade tqsim
Usage
1. Basic Example
In this example, we create a circuit with 2 qudits, made of 3 anyons each. We then braid the anyons manually. ```python from tqsim import AnyonicCircuit
circuit = AnyonicCircuit(2, 3) # Create a circuit having 2 qudits and 3 anyons per qudits
circuit.braid(1, 2) # Braids the first with the second anyon
circuit.braid(3, 4) # Braids the first with the second anyon
circuit.braid(2, 1)
circuit.measure() # Measure the system by fusing the anyons
circuit.draw() # Draw the circuit
``
Here is the output of thedraw()` method:

Simulating the circuit:
```python circuit.run(shots = 50)
```
Output:
bash
{'counts': {'0': 16, '2': 20, '4': 14}, 'memory': array([4, 2, 2, 2, 2, 2, 2, 4, 2, 4, 2, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 4,
2, 4, 0, 2, 0, 0, 0, 0, 4, 4, 2, 2, 2, 4, 2, 2, 0, 0, 2, 4, 2, 2,
4, 2, 4, 4, 0, 2])}
2. Simulating a Hadamard gate
Here we simulate the application of a Hadamard gate on a single qudit with 3 anyons. Unlike the previous example, we will use a braiding sequence of braiding operators and their corresponding powers. ```python from tqsim import AnyonicCircuit
circuit = AnyonicCircuit(nbqudits=1, nbanyonsperqudit=3) # Create a circuit with 1 qudit composed of 3 anyons circuit.initialize([0,0,1]) # We initialize the circuit in the last state (state 2). # For this circuit, we have 3 basis states: [0, 1, 2].
The Hadamard gate braiding sequence in terms of braiding operators
had_sequence = [[1, 2], [2, 2], [1, -2], [2, -2], [1, 2], [2, 4], [1, -2], [2, 2], [1, 2], [2, -2], [1, 2], [2, -2], [1, 4]]
circuit.braidsequence(hadsequence) # We apply the braiding sequence. # This should put our qudit in a superposition of the states 2 and 1. circuit.measure() # Measure the system by fusing the anyons circuit.draw() # Draw the circuit ``` The Hadamard braid looks like this

Simulating the circuit:
```python result = circuit.run(shots = 1000) # Run the circuit 1000 times. print(result['counts']) # Show the counts only.
```
Output:
bash
{'1': 493, '2': 507}
Authors and Citation
Abdellah Tounsi, Mohamed Messaoud Louamri, Nacer eddine Belaloui, and Mohamed Taha Rouabah – Constantine Quantum Technologies.
If you have used TQSim in your work, please use the BibTeX file to cite the authors.
License
Copyright © 2022, Constantine Quantum Technologies. Released under the Apache License 2.0.
Owner
- Name: CQTech
- Login: Constantine-Quantum-Tech
- Kind: organization
- Location: Algeria
- Repositories: 2
- Profile: https://github.com/Constantine-Quantum-Tech
Citation (citation.bib)
@misc{ TQSim,
author = {Abdellah Tounsi and Mohamed Messaoud Louamri and Nacer eddine Belaloui and Mohamed Taha Rouabah},
title = {TQSim, a Topological Quantum Computing Simulator based on anyon models},
year = {2022},
affiliation= {Constantine Quantum Technologies},
url = {https://github.com/Constantine-Quantum-Tech/tqsim}
}
GitHub Events
Total
- Issues event: 2
- Delete event: 1
- Issue comment event: 2
- Push event: 8
- Pull request event: 2
- Create event: 1
Last Year
- Issues event: 2
- Delete event: 1
- Issue comment event: 2
- Push event: 8
- Pull request event: 2
- Create event: 1
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Belaloui | i****n@g****m | 20 |
| MohamedML | m****i@g****m | 18 |
| Mohamed Messaoud Louamri | 1****i | 13 |
| Nacer eddine BELALOUI | 6****i | 12 |
| Abduhu | 4****u | 4 |
| Taha-Rouabah | m****h@g****m | 2 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 25
- Total pull requests: 25
- Average time to close issues: 3 days
- Average time to close pull requests: about 21 hours
- Total issue authors: 4
- Total pull request authors: 2
- Average comments per issue: 0.36
- Average comments per pull request: 0.44
- Merged pull requests: 22
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 9 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.5
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Belaloui (14)
- Abduhu (5)
- mmlouamri (5)
- jagandecapri (1)
Pull Request Authors
- mmlouamri (25)
- Belaloui (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 31 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
pypi.org: tqsim
TQSim is a Topological Quantum Computing simulator based on Anyon models
- Homepage: https://github.com/Constantine-Quantum-Tech/tqsim
- Documentation: https://tqsim.readthedocs.io/
- License: Apache-2.0
-
Latest release: 0.0.2
published about 3 years ago
Rankings
Maintainers (1)
Dependencies
- attrs 22.1.0 develop
- cfgv 3.3.1 develop
- colorama 0.4.6 develop
- distlib 0.3.6 develop
- exceptiongroup 1.0.0 develop
- filelock 3.8.0 develop
- identify 2.5.8 develop
- iniconfig 1.1.1 develop
- nodeenv 1.7.0 develop
- platformdirs 2.5.2 develop
- pluggy 1.0.0 develop
- pre-commit 2.20.0 develop
- pytest 7.2.0 develop
- pyyaml 6.0 develop
- toml 0.10.2 develop
- virtualenv 20.16.6 develop
- contourpy 1.0.6
- cycler 0.11.0
- fonttools 4.38.0
- kiwisolver 1.4.4
- matplotlib 3.6.1
- numpy 1.23.4
- packaging 21.3
- pillow 9.3.0
- pyparsing 3.0.9
- python-dateutil 2.8.2
- setuptools 65.5.0
- setuptools-scm 7.0.5
- six 1.16.0
- tomli 2.0.1
- typing-extensions 4.4.0
- matplotlib ^3.6.1
- numpy ^1.23.4
- python ^3.8