iqm-finland / cirq-on-iqm Goto Github PK
View Code? Open in Web Editor NEWCirq adapter for IQM's quantum computers
Home Page: https://iqm-finland.github.io/cirq-on-iqm/
License: Apache License 2.0
Cirq adapter for IQM's quantum computers
Home Page: https://iqm-finland.github.io/cirq-on-iqm/
License: Apache License 2.0
Fix the current hack of using a fixed number of iterations in simplify_circuit
by directly comparing old and new circuit to check whether any optimisation was applied.
The change would look something like this:
while True:
old_circuit = circuit.copy()
MergeOneParameterGroupGates().optimize_circuit(circuit)
optimizers.merge_single_qubit_gates_into_phased_x_z(circuit)
# all z rotations are pushed past the first two-qubit gate following them
IQMEjectZ(eject_parameterized=True).optimize_circuit(circuit)
optimizers.DropEmptyMoments().optimize_circuit(circuit)
# Circuit has reached a fixed point.
if circuit == old_circuit:
break
Since (potentially breaking) changes to Cirq would not automatically test against the code in cirq-on-iqm
, we should setup automated tests (using github actions?) in cirq-on-iqm
running against the latest version of Cirq to raise an alert whenever there's a breaking change so that it can be detected early on and necessary migrations can be done.
cc @balopat
iqm_device.py is currently very large and contains a lot of functionality. It would be nice if it can be split into multiple files, each with a specific function, for easier organisation and clarity. An example would be:
cc @balopat
Add action for compiling and publishing docs to GitHub Pages for example on push to main
Running
tox -e docs
and publishing output in gh-pages using JamesIves/github-pages-deploy-action or similar should work.
The comment in IsingGate
class says that it's needed because cirq.ops.ZZPowGate
contains decomposition logic which iqm wants to avoid.
Since the decomposition logic of a gate is mainly called when the code dealing with the gate (eg: Simulator) doesn't understand what the gate is, it's not clear to me how is the default decomposition logic of ZZPowGate
in Cirq causing an issue for IQM?
If the problem is that because the hardware natively supports IsingGate
and therefore we want to use it as a primitive in cirq circuits, I think it would be better if we implement it by inheriting from cirq.ops.ZZPowGate
and passing the global phase as an init parameter. A similar approach is used in Cirq to implement Mølmer–Sørensen Gate
by extending cirq.XXPowGate
.
Another approach could be to use ZZPowGate
in the cirq circuits (for optimisation and simulation) and convert to an appropriate representation (of IsingGate
) -- which the hardware understands -- during the serialisation step when the circuit has to be sent to the hardware. For Eg: See Serialiser of IonQ that does something similar.
cc @balopat
It would be good to start thinking about how the users (for eg: students) would connect to the IQM Device. Ideally, this should also be present in a tutorial notebook.
Steps to reproduce:
$> conda create -n iqm_test python==3.9
$> conda activate iqm_test
$> pip install cirq-iqm
ERROR: Could not find a version that satisfies the requirement cirq-iqm
ERROR: No matching distribution found for cirq-iqm
(base) $> conda create -n iqm_test python==3.9
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /Users/tanujkhattar/opt/anaconda3/envs/iqm_test
added / updated specs:
- python==3.9
The following NEW packages will be INSTALLED:
ca-certificates pkgs/main/osx-64::ca-certificates-2021.4.13-hecd8cb5_1
certifi pkgs/main/osx-64::certifi-2020.12.5-py39hecd8cb5_0
libcxx pkgs/main/osx-64::libcxx-10.0.0-1
libffi pkgs/main/osx-64::libffi-3.3-hb1e8313_2
ncurses pkgs/main/osx-64::ncurses-6.2-h0a44026_1
openssl pkgs/main/osx-64::openssl-1.1.1k-h9ed2024_0
pip pkgs/main/osx-64::pip-21.0.1-py39hecd8cb5_0
python pkgs/main/osx-64::python-3.9.0-h88f2d9e_2
readline pkgs/main/osx-64::readline-8.1-h9ed2024_0
setuptools pkgs/main/osx-64::setuptools-52.0.0-py39hecd8cb5_0
sqlite pkgs/main/osx-64::sqlite-3.35.4-hce871da_0
tk pkgs/main/osx-64::tk-8.6.10-hb0a8c7a_0
tzdata pkgs/main/noarch::tzdata-2020f-h52ac0ba_0
wheel pkgs/main/noarch::wheel-0.36.2-pyhd3eb1b0_0
xz pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
zlib pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) $> conda activate iqm_test
(iqm_test) $> pip install cirq-iqm
ERROR: Could not find a version that satisfies the requirement cirq-iqm
ERROR: No matching distribution found for cirq-iqm
Cirq has guidelines for notebooks and it would be nice to align with it.
An immediate action item would be to add a header cell that includes commands for packages installation (pip install
statements) so that the notebook can be run independently on Google Colab.
cc @balopat
Cirq has a growing community of contributors and it would be nice if the contributor experience and processes of cirq-on-iqm
are similar to that of cirq
. Some concrete suggestions for changes would be
cc @balopat
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.