Skip to content

Commit

Permalink
Merge branch 'hotfix/slimer-docker-image' into 'main'
Browse files Browse the repository at this point in the history
Hotfix/slimer docker image

See merge request chalmersnextlabs-quantum/tergite-backend!23
  • Loading branch information
ch-ahindura committed Dec 23, 2024
2 parents b7abd6d + 6720560 commit e60ccf2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 39 deletions.
60 changes: 25 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ WORKDIR /code
# for the pip install step
COPY ./requirements.txt /code/requirements.txt

# Extract the core requirements that have a dependency of PyQt5; a difficult package to install
RUN grep -E '^(quantify-core|quantify-scheduler)' /code/requirements.txt >> core-requirements.txt; \
# show core-requirements for debugging
cat core-requirements.txt;
# Install PyQt5
RUN apt-get update -y; \
apt-get install -y --no-install-recommends python3-pyqt5;\
apt-get clean; \
rm -rf /var/lib/apt/lists/*;

# Clean up code/requirements.txt file
RUN \
# Extract the core requirements that have a dependency of PyQt5; a difficult package to install
grep -E '^(quantify-core|quantify-scheduler)' /code/requirements.txt >> core-requirements.txt; \
# show core-requirements for debugging
cat core-requirements.txt; \
# Clean up code/requirements.txt file, remove the dev-dependencies
sed -i '/^# dev-dependencies/q' /code/requirements.txt; \
# comment out the packages that may need PyQt5
sed -i "s:quantify-core:# quantify-core:" /code/requirements.txt; \
sed -i "s:quantify-scheduler:# quantify-scheduler:" /code/requirements.txt;

RUN apt update -y && apt install -y python3-pyqt5;
RUN pip install --no-cache-dir pipdeptree~=2.24.0; \
pip install --upgrade --no-cache-dir -r /code/requirements.txt

# Install quantify-core and quantify-scheduler without dependencies
RUN pip install --upgrade --no-deps --no-cache-dir -r core-requirements.txt; \
rm core-requirements.txt;

# Extract all the yet-to-be-installed required dependencies
RUN pipdeptree -w silence -p quantify-core >> pending-requirements.txt; \
sed -i "s:quantify-scheduler:# quantify-scheduler:" /code/requirements.txt; \
# Install the pip dependencies except the core ones
pip install --no-cache-dir pipdeptree~=2.24.0; \
pip install --no-cache-dir -r /code/requirements.txt; \
# Install quantify-core and quantify-scheduler without dependencies
pip install --no-deps --no-cache-dir -r core-requirements.txt; \
rm core-requirements.txt; \
# Extract all the yet-to-be-installed required dependencies
pipdeptree -w silence -p quantify-core >> pending-requirements.txt; \
pipdeptree -w silence -p quantify-scheduler >> pending-requirements.txt; \
pip uninstall -y pipdeptree;

# Cleaning up the pending-requirements.txt
RUN \
pip uninstall -y pipdeptree; \
# Cleaning up the pending-requirements.txt
# remove indirect dependencies of quantify-core and quantify-scheduler
sed -i "s:^│[[:space:]]*├──.*::" pending-requirements.txt; \
sed -i "s:^│[[:space:]]*└──.*::" pending-requirements.txt; \
Expand All @@ -54,20 +54,10 @@ RUN \
# remove empty lines
sed -i.bak "/^$/d" pending-requirements.txt; \
# print the final output for debugging purposes
cat pending-requirements.txt;

# Install all yet-to-be-installed dependencies except pyqt5
RUN pip install --no-cache-dir --upgrade -r pending-requirements.txt; \
rm pending-requirements.txt

# clear pip's cache
RUN pip cache purge

# clear the build dependencies
RUN \
# apt remove -y --auto-remove gcc g++ gfortran libopenblas-dev liblapack-dev python3-dev python3-pip; \
apt autoremove; \
apt clean;
cat pending-requirements.txt; \
# Install all yet-to-be-installed dependencies except pyqt5
pip install --no-cache-dir -r pending-requirements.txt; \
rm pending-requirements.txt;

COPY . /code/

Expand Down
5 changes: 1 addition & 4 deletions app/libs/quantum_executor/qiskit/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@
# that they have been altered from the originals.

import numpy as np
import datetime

import jax

from qiskit.providers.models import PulseBackendConfiguration, GateConfig, PulseDefaults
from qiskit.quantum_info import Statevector
from qiskit_dynamics import DynamicsBackend, Solver
from qiskit.transpiler import Target, InstructionProperties
from qiskit.transpiler import Target
from qiskit.providers import QubitProperties
from qiskit.pulse import Acquire, AcquireChannel, MemorySlot, Schedule
from qiskit.circuit import Delay, Reset, Parameter
from qiskit.circuit.library import XGate, SXGate, RZGate

from sklearn.discriminant_analysis import LinearDiscriminantAnalysis

Expand Down
1 change: 1 addition & 0 deletions docs/executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ It manages the access to the instruments or sets up the simulator in case the ba
Right now, we have implemented the following backends:
- "quantify": This is interfacing to qblox quantify via quantify and the recommended option, because the WACQT quantum processor is running on that platform. It can be run in the dummy mode, check out the [configuration manual](./configuration.md) on how to do it.
- "qiskit_pulse_1q": Single qubit simulator using qiskit-dynamics
- "qiskit_pulse_2q": Two-qubit gate simulator using qiskit-dynamics

If you want to implement a new executor, follow these steps below.

Expand Down

0 comments on commit e60ccf2

Please sign in to comment.