interlin-q
A Quantum Interconnect Simulator for Distributed Quantum Algorithms
Science Score: 44.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
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.4%) to scientific vocabulary
Keywords
Repository
A Quantum Interconnect Simulator for Distributed Quantum Algorithms
Basic Info
- Host: GitHub
- Owner: Interlin-q
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://interlin-q.github.io/Interlin-q/
- Size: 3.29 MB
Statistics
- Stars: 46
- Watchers: 5
- Forks: 11
- Open Issues: 10
- Releases: 1
Topics
Metadata Files
README.md
Interlin-q
This is a distributed quantum-enabled simulator which imitates the master-slave centralised-control distributed quantum computing system with interconnect communication between the nodes. Using this simulator, one can input any monolithic circuit as well as a distributed quantum computing topology and see the execution of the distributed algorithm happening in real time. The simulator maps the monolithic circuit to a distributed quantum computing achitecture and uses a master-slave relation with a centralized controller communicating to computing nodes in the network. Interlin-q can be used for designing and analysing novel distributed quantum algorithms for various distributed quantum computing architectures.
The method used to accomplish this is based on the following paper:
Distributed Quantum Computing and Network Control for Accelerated VQE
Stephen DiAdamo, Marco Ghibaudi, James Cruise (arXiv: 2101.02504)
The simulated architecture can be seen in the image below:

Setup, tests and documentation
See https://interlin-q.github.io/Interlin-q for documentation. To setup Interlin-q, run the below command.
pip install -r requirements.txt
To run tests, run the below command.
nose2
Quick Start Guide
Quick Example
A basic template of a distributed CNOT gate between two different computing hosts is shown in the file examples/template.py, where the control qubit in first computing host is set in |1> state and the target qubit in the second computing host is set in |0> state.
``` def createcircuit(qmap): layers = [] computinghostids = list(q_map.keys())
# Prepare the qubits on both computing hosts
ops = []
for host_id in computing_host_ids:
op = Operation(
name=Constants.PREPARE_QUBITS,
qids=q_map[host_id],
computing_host_ids=[host_id])
ops.append(op)
layers.append(Layer(ops))
# Circuit input should be added below
# Put qubit "q_0_0" in |1> state
op = Operation(
name=Constants.SINGLE,
qids=[q_map[computing_host_ids[0]][0]],
gate=Operation.X,
computing_host_ids=[computing_host_ids[0]])
ops.append(op)
layers.append(Layer(ops))
# Apply cnot gate from "q_0_0" to "q_1_0"
control_qubit_id = q_map[computing_host_ids[0]][0]
target_qubit_id = q_map[computing_host_ids[1]][0]
op = Operation(
name=Constants.TWO_QUBIT,
qids=[control_qubit_id, target_qubit_id],
gate=Operation.CNOT,
computing_host_ids=computing_host_ids)
layers.append(Layer([op]))
# Measure the qubits
ops = []
for host_id in computing_host_ids:
op = Operation(
name=Constants.MEASURE,
qids=[q_map[host_id][0]],
cids=[q_map[host_id][0]],
computing_host_ids=[host_id])
ops.append(op)
layers.append(Layer(ops))
circuit = Circuit(q_map, layers)
return circuit
def controllerhostprotocol(host, qmap): """ Protocol for the controller host """ circuit = createcircuit(qmap) host.generateandsendschedules(circuit) host.receive_results()
results = host.results
computing_host_ids = host.computing_host_ids
print('Final results: \n')
for computing_host_id in computing_host_ids:
bits = results[computing_host_id]['bits']
for bit_id, bit in bits.items():
print("{0}: {1}".format(bit_id, bit))
def computinghostprotocol(host): """ Protocol for the computing hosts """ host.receiveschedule() host.sendresults()
def main(): # initialize network network = Network.get_instance() network.start()
clock = Clock()
controller_host = ControllerHost(host_id="host_1", clock=clock)
# Here the number of computing hosts and number of qubits per computing hosts
# can be customised
computing_hosts, q_map = controller_host.create_distributed_network(
num_computing_hosts=2,
num_qubits_per_host=2)
controller_host.start()
network.add_host(controller_host)
for host in computing_hosts:
network.add_host(host)
print('starting...')
t = controller_host.run_protocol(controller_host_protocol, (q_map,))
threads = [t]
for host in computing_hosts:
t = host.run_protocol(computing_host_protocol)
threads.append(t)
for thread in threads:
thread.join()
network.stop(True)
exit()
if name == 'main': main() ```
In the template, the monolothic circuit can be added in the create_circuit function, which will automatically be distributed by the controller host and performed by the computing hosts. The operations needed to perform the monolithic circuit should be added layer by layer. The specific topology required to perform the circuit can be customised by changing the number of computing hosts required to perform the circuit and as well as changing the number of qubits required per computing hosts.
Distributed Quantum Phase Estimation Tutorial
A tutorial of Distributed Quantum Phase Estimation algorithm can be found here.
Contributing
We welcome contributors. Feel free to open an issue on this repository or add a pull request to submit your patch/contribution. Adding test cases for any contributions is a requirement for any pull request to be merged.
Citing
@article{parekh2021quantum,
title={Quantum Algorithms and Simulation for Parallel and Distributed Quantum Computing},
author={Parekh, Rhea and Ricciardi, Andrea and Darwish, Ahmed and DiAdamo, Stephen},
journal={arXiv preprint arXiv:2106.06841},
year={2021}
}
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: DiAdamo
given-names: Stephen
- family-names: Parekh
given-names: Rhea
- family-names: Darwish
given-names: Ahmed
title: "Interlin-q"
version: 0.0.1
date-released: 2021-06-01
url: "https://github.com/Interlin-q/Interlin-q"
GitHub Events
Total
- Watch event: 4
- Fork event: 1
Last Year
- Watch event: 4
- Fork event: 1
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Rhea Parekh | r****2@g****m | 55 |
| Stephen Diadamo | s****o@g****m | 49 |
| Shiro-Raven | e****4@g****m | 14 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 19
- Total pull requests: 34
- Average time to close issues: 23 days
- Average time to close pull requests: 4 days
- Total issue authors: 4
- Total pull request authors: 3
- Average comments per issue: 1.32
- Average comments per pull request: 0.29
- Merged pull requests: 32
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- stephendiadamo (11)
- Shiro-Raven (5)
- rheaparekh (2)
- zemenfes-afk (1)
Pull Request Authors
- stephendiadamo (18)
- rheaparekh (11)
- Shiro-Raven (5)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 22 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 6
- Total maintainers: 2
pypi.org: interlin-q
A Distributed Quantum Computing Framework
- Homepage: https://github.com/Interlin-q/Interlin-q
- Documentation: https://interlin-q.readthedocs.io/
- License: MIT
-
Latest release: 0.0.1.post5
published about 5 years ago
Rankings
Maintainers (2)
Dependencies
- Babel ==2.9.0
- EQSN ==0.0.8
- Jinja2 ==2.11.2
- MarkupSafe ==1.1.1
- Pillow ==8.0.1
- Pygments ==2.7.4
- Sphinx ==3.4.3
- alabaster ==0.7.12
- appnope ==0.1.2
- async-generator ==1.10
- attrs ==20.3.0
- backcall ==0.2.0
- bleach ==3.2.2
- certifi ==2020.6.20
- chardet ==4.0.0
- coverage ==5.3
- cycler ==0.10.0
- decorator ==4.4.2
- defusedxml ==0.6.0
- docutils ==0.16
- entrypoints ==0.3
- idna ==2.10
- imagesize ==1.2.0
- importlib-metadata ==3.4.0
- ipython ==7.16.1
- ipython-genutils ==0.2.0
- jedi ==0.18.0
- jsonschema ==3.2.0
- jupyter-client ==6.1.11
- jupyter-core ==4.7.0
- jupyterlab-pygments ==0.1.2
- kiwisolver ==1.2.0
- matplotlib ==3.3.2
- mistune ==0.8.4
- nbclient ==0.5.1
- nbconvert ==6.0.7
- nbformat ==5.1.2
- nbsphinx ==0.8.1
- nest-asyncio ==1.4.3
- networkx ==2.5
- nose2 ==0.9.2
- numpy ==1.19.2
- packaging ==20.8
- pandoc ==1.0.2
- pandocfilters ==1.4.3
- parso ==0.8.1
- pexpect ==4.8.0
- pickleshare ==0.7.5
- ply ==3.11
- prompt-toolkit ==3.0.14
- ptyprocess ==0.7.0
- pyparsing ==2.4.7
- pyrsistent ==0.17.3
- python-dateutil ==2.8.1
- pytz ==2020.5
- pyzmq ==21.0.1
- qunetsim ==0.1.1.post3
- requests ==2.25.1
- six ==1.15.0
- snowballstemmer ==2.1.0
- sphinx-rtd-theme ==0.5.1
- sphinxcontrib-applehelp ==1.0.2
- sphinxcontrib-devhelp ==1.0.2
- sphinxcontrib-htmlhelp ==1.0.3
- sphinxcontrib-jsmath ==1.0.1
- sphinxcontrib-qthelp ==1.0.3
- sphinxcontrib-serializinghtml ==1.1.4
- testpath ==0.4.4
- tornado ==6.1
- traitlets ==4.3.3
- typing-extensions ==3.7.4.3
- urllib3 ==1.26.2
- wcwidth ==0.2.5
- webencodings ==0.5.1
- zipp ==3.4.0