Skip to main content

A Cirq package to simulate and connect to Scaleway Quantum as a Service

Project description

cirq-scaleway

Cirq is a Python library for writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators.

This module is cirq-scaleway, which provides everything you’ll need to run Cirq quantum algorithms on Scaleway Quantum as a Service (QaaS).

Official QaaS web page

Documentation

To get started with Scaleway Quantum as a Service (QaaS), checkout the following guide and tutorial:

Installation

To install the stable version of only cirq-scaleway:

>>> pip install cirq-scaleway

Note, that this will install both cirq-scaleway and cirq-core.

To get all the optional modules installed, you’ll have to use pip install cirq or pip install cirq~=1.0.dev for the pre-release version.

Getting started

In the most simple way, here the code to use cirq-scaleway:

>>> import cirq
>>> from cirq_scaleway import ScalewayQuantumService
>>> service = ScalewayQuantumService(
    project_id="<your-scaleway-project-id>", secret_key="<your-scaleway-secret-key>"
)
>>> # Get and display all provided (real or simulated) devices compatible with Cirq
>>> devices = service.devices(min_num_qubits=34)
>>> print(devices)
>>> # Get a specific device by its name
>>> qsim_simulator = service.device(name="qsim_simulation_c64m512")
>>> # Create a device session and run a circuit against it
>>> with qsim_simulator.create_session() as session:
>>>   qubit = cirq.GridQubit(0, 0)
>>>   circuit = cirq.Circuit(cirq.X(qubit) ** 0.5, cirq.measure(qubit, key='m'))
>>>   # Run the circuit on the device
>>>   result = session.run(circuit)
>>>   print(result)

Reach us

We love feedback. Feel free to reach us on Scaleway Slack community, we are waiting for you on #opensource.

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

cirq-scaleway-0.1.2.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

cirq_scaleway-0.1.2-py3-none-any.whl (16.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page