Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove QIR #238

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,40 @@ jobs:
name: ${{ matrix.os }}, python${{ matrix.python-version }}, ${{ matrix.case-name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Continue running jobs even if a previous job fails
matrix:
include:
- case-name: qutip@5.0.0
os: ubuntu-latest
qutip-version: '==5.0.0'
pyqir-version: ''
python-version: '3.11'
- case-name: qutip@qutip-4.7.X
os: ubuntu-latest
qutip-version: '@qutip-4.7.X'
pyqir-version: ''
python-version: '3.10'
- case-name: qutip@master
os: ubuntu-latest
qutip-version: '@master'
pyqir-version: ''
python-version: '3.12'
- case-name: qutip@4.7
os: macOS-latest
qutip-version: '==4.7.*'
qiskit-version: ''
pyqir-version: ''
python-version: '3.11'
- case-name: qiskit+qir
- case-name: qiskit
os: windows-latest
qutip-version: ''
qiskit-version: '==0.46.*'
pyqir-version: '==0.6.2'
python-version: '3.9'
- case-name: qiskit+qir
- case-name: qiskit
os: macOS-latest
qutip-version: ''
qiskit-version: '==0.46.*'
pyqir-version: '==0.6.2'
python-version: '3.9'
- case-name: qiskit+qir
- case-name: qiskit
os: ubuntu-latest
qutip-version: ''
qiskit-version: '==0.46.*'
pyqir-version: '==0.6.2'
python-version: '3.9'

steps:
Expand All @@ -72,11 +66,6 @@ jobs:
if: ${{ matrix.qiskit-version != '' }}
run: python -m pip install 'qiskit${{ matrix.qiskit-version }}' 'qiskit-aer==0.14.0.1'

- name: Install PyQIR from PyPI
if: ${{ matrix.pyqir-version != '' }}
# We use each subpackage explicitly here; see https://github.com/qir-alliance/pyqir/issues/167.
run: python -m pip install 'pyqir-generator${{ matrix.pyqir-version }}' 'pyqir-parser${{ matrix.pyqir-version }}'

- name: Install qutip-qip
# Installing in-place so that coveralls can locate the source code.
run: |
Expand Down
2 changes: 0 additions & 2 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ numpydoc==1.4.0
matplotlib==3.5.2
docutils==0.17.1
sphinxcontrib-bibtex==2.4.2
pyqir-generator==0.6.2
pyqir-parser==0.6.2
qiskit==0.46.1
qiskit-aer==0.14.0.1
1 change: 0 additions & 1 deletion doc/source/apidoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Simulation based on operator-state multiplication.
qutip_qip.qubits
qutip_qip.decompose
qutip_qip.qasm
qutip_qip.qir
qutip_qip.vqa

Pulse-level simulation
Expand Down
16 changes: 0 additions & 16 deletions doc/source/apidoc/qutip_qip.qir.rst

This file was deleted.

23 changes: 1 addition & 22 deletions doc/source/qip-simulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ We are left with a mixed state.
Import and export quantum circuits
==================================

QuTiP supports importing and exporting quantum circuits in the `OpenQASM 2.0 <https://github.com/Qiskit/openqasm/tree/OpenQASM2.x>`_ format, as well as exporting circuits to `Quantum Intermediate Representation <https://www.qir-alliance.org/>`_.
QuTiP supports importing and exporting quantum circuits in the `OpenQASM 2.0 <https://github.com/Qiskit/openqasm/tree/OpenQASM2.x>`_ format.
To import from and export to OpenQASM 2.0, you can use the :func:`.read_qasm` and :func:`.save_qasm` functions, respectively.
We demonstrate this functionality by loading a circuit for preparing the :math:`\left|W\right\rangle`-state from an OpenQASM 2.0 file.
The following code is in OpenQASM format:
Expand Down Expand Up @@ -326,24 +326,3 @@ One can save it in a ``.qasm`` file and import it using the following code:

from qutip_qip.qasm import read_qasm
qc = read_qasm("source/w-state.qasm")

QuTiP circuits can also be exported to QIR:

.. doctest::

>>> from qutip_qip.circuit import QubitCircuit
>>> from qutip_qip.qir import circuit_to_qir

>>> circuit = QubitCircuit(3, num_cbits=2)
>>> msg, here, there = range(3)
>>> circuit.add_gate("RZ", targets=[msg], arg_value=0.123)
>>> circuit.add_gate("SNOT", targets=[here])
>>> circuit.add_gate("CNOT", targets=[there], controls=[here])
>>> circuit.add_gate("CNOT", targets=[here], controls=[msg])
>>> circuit.add_gate("SNOT", targets=[msg])
>>> circuit.add_measurement("Z", targets=[msg], classical_store=0)
>>> circuit.add_measurement("Z", targets=[here], classical_store=1)
>>> circuit.add_gate("X", targets=[there], classical_controls=[0])
>>> circuit.add_gate("Z", targets=[there], classical_controls=[1])

>>> print(circuit_to_qir(circuit, "text")) # doctest: +SKIP
236 changes: 0 additions & 236 deletions src/qutip_qip/qir.py

This file was deleted.

Loading
Loading