All Projects → Interlin-q → Interlin-q

Interlin-q / Interlin-q

Licence: MIT license
A Quantum Interconnect Simulator for Distributed Quantum Algorithms

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Interlin-q

Qpp
A modern C++11 quantum computing library
Stars: ✭ 277 (+765.63%)
Mutual labels:  simulator, quantum, quantum-computing
Quantum Circuit
Quantum Circuit Simulator implemented in JavaScript
Stars: ✭ 157 (+390.63%)
Mutual labels:  simulator, quantum, quantum-computing
QuantumResources
A collection of resources for Quantum Computing
Stars: ✭ 43 (+34.38%)
Mutual labels:  quantum, quantum-computing
Qpanda 2
QPanda 2 is an open source quantum computing framework developed by OriginQC that can be used to build, run, and optimize quantum algorithms.
Stars: ✭ 128 (+300%)
Mutual labels:  quantum, quantum-computing
Q.js
Quantum computing in your browser.
Stars: ✭ 158 (+393.75%)
Mutual labels:  quantum, quantum-computing
Qmlt
The Quantum Machine Learning Toolbox (QMLT) is a Strawberry Fields application that simplifies the optimization of variational quantum circuits (also known as parametrized quantum circuits).
Stars: ✭ 106 (+231.25%)
Mutual labels:  quantum, quantum-computing
Teach Me Quantum
⚛ 10 week Practical Course on Quantum Information Science and Quantum Computing - with Qiskit and IBMQX
Stars: ✭ 118 (+268.75%)
Mutual labels:  quantum, quantum-computing
Learnquantum
Repo of resources to help learn about quantum computing.
Stars: ✭ 143 (+346.88%)
Mutual labels:  quantum, quantum-computing
Pyepr
Powerful, automated analysis and design of quantum microwave chips & devices [Energy-Participation Ratio and more]
Stars: ✭ 81 (+153.13%)
Mutual labels:  quantum, quantum-computing
Quantum Neural Networks
This repository contains the source code used to produce the results presented in the paper "Continuous-variable quantum neural networks". Due to subsequent interface upgrades, these scripts will work only with Strawberry Fields version <= 0.10.0.
Stars: ✭ 207 (+546.88%)
Mutual labels:  quantum, quantum-computing
cas
Cellular Automata Simulator
Stars: ✭ 22 (-31.25%)
Mutual labels:  simulator, quantum
Awesome Quantum Computing
A curated list of awesome quantum computing learning and developing resources.
Stars: ✭ 1,350 (+4118.75%)
Mutual labels:  quantum, quantum-computing
Q
Quantum Computation Simulator written in golang
Stars: ✭ 99 (+209.38%)
Mutual labels:  quantum, quantum-computing
Quantum Nc
Microsoft Quantum Computing Libraries for noncommercial use
Stars: ✭ 126 (+293.75%)
Mutual labels:  quantum, quantum-computing
Quantum Learning
This repository contains the source code used to produce the results presented in the paper "Machine learning method for state preparation and gate synthesis on photonic quantum computers".
Stars: ✭ 89 (+178.13%)
Mutual labels:  quantum, quantum-computing
Awesome Quantum Machine Learning
Here you can get all the Quantum Machine learning Basics, Algorithms ,Study Materials ,Projects and the descriptions of the projects around the web
Stars: ✭ 1,940 (+5962.5%)
Mutual labels:  quantum, quantum-computing
Quantum Benchmarks
benchmarking quantum circuit emulators for your daily research usage
Stars: ✭ 70 (+118.75%)
Mutual labels:  quantum, quantum-computing
Qrack
Comprehensive, GPU accelerated framework for developing universal virtual quantum processors
Stars: ✭ 79 (+146.88%)
Mutual labels:  quantum, quantum-computing
Quimb
A python library for quantum information and many-body calculations including tensor networks.
Stars: ✭ 170 (+431.25%)
Mutual labels:  quantum, quantum-computing
Qvm
The @rigetti high-performance quantum virtual machine.
Stars: ✭ 300 (+837.5%)
Mutual labels:  simulator, quantum-computing

Unitary Fund

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:

Simulated Architecture

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 create_circuit(q_map):
    layers = []
    computing_host_ids = 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 controller_host_protocol(host, q_map):
    """
    Protocol for the controller host
    """
    circuit = create_circuit(q_map)
    host.generate_and_send_schedules(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 computing_host_protocol(host):
    """
    Protocol for the computing hosts
    """
    host.receive_schedule()
    host.send_results()

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}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].