Skip to content

Commit

Permalink
Merge branch 'main' into alvaro/latest
Browse files Browse the repository at this point in the history
  • Loading branch information
aorgazf committed Oct 23, 2023
2 parents c0fd74e + 0ab2ef7 commit b7b3cbe
Show file tree
Hide file tree
Showing 16 changed files with 470 additions and 462 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests using qibolab main
on: push
jobs:
tests:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install and configure poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install qibolab
run: |
git clone https://github.com/qiboteam/qibolab
cd qibolab
poetry install --no-interaction --with tests --all-extras
- name: Test platforms
run: |
cd qibolab
QIBOLAB_PLATFORMS=$(realpath ..) poetry run pytest ../tests/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Tests using qibolab stable
on: push
jobs:
tests:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
autofix_prs: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -18,6 +18,6 @@ repos:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.13.0
rev: v3.15.0
hooks:
- id: pyupgrade
86 changes: 43 additions & 43 deletions iqm5q.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@

from qibolab import Platform
from qibolab.channels import Channel, ChannelMap
from qibolab.instruments.erasynth import ERA
from qibolab.instruments.oscillator import LocalOscillator
from qibolab.instruments.rohde_schwarz import SGS100A
from qibolab.instruments.zhinst import Zurich
from qibolab.serialize import load_qubits, load_runcard, load_settings
from qibolab.serialize import (
load_instrument_settings,
load_qubits,
load_runcard,
load_settings,
)

RUNCARD = pathlib.Path(__file__).parent / "iqm5q.yml"

TWPA_ADDRESS = "192.168.0.210"
TWPA_ADDRESS = "192.168.0.32"


def create(runcard_path=RUNCARD):
Expand Down Expand Up @@ -73,18 +78,18 @@ def create(runcard_path=RUNCARD):
descriptor,
use_emulation=False,
time_of_flight=75,
smearing=50, # time_of_flight=280, smearing=100
smearing=50,
)

# Create channel objects and map controllers
channels = ChannelMap()
# readout
# feedback
channels |= Channel(
"L3-31", port=controller[("device_shfqc", "[QACHANNELS/0/INPUT]")]
"L2-7", port=controller[("device_shfqc", "[QACHANNELS/0/INPUT]")]
)
# feedback
# readout
channels |= Channel(
"L2-7", port=controller[("device_shfqc", "[QACHANNELS/0/OUTPUT]")]
"L3-31", port=controller[("device_shfqc", "[QACHANNELS/0/OUTPUT]")]
)
# drive
channels |= (
Expand All @@ -104,18 +109,19 @@ def create(runcard_path=RUNCARD):
for i in range(11, 14)
)
channels |= Channel("L4-14", port=controller[("device_hdawg2", f"SIGOUTS/0")])

# TWPA pump(EraSynth)
channels |= Channel("L3-32")

# SHFQC
# Sets the maximal Range of the Signal Output power.
# The instrument selects the closest available Range with a resolution of 5 dBm.
# The instrument selects the closest available Range [-50. -30. -25. -20. -15. -10. -5. 0. 5. 10.]
# with a resolution of 5 dBm.

# readout "gain": Set to max power range (10 Dbm) if no distorsion
channels["L3-31"].power_range = -15
# feedback "gain": play with the power range to calibrate the best RO
channels["L2-7"].power_range = 10

# feedback
channels["L3-31"].power_range = 10
# readout
channels["L2-7"].power_range = -25
# drive
for i in range(5, 10):
channels[f"L4-1{i}"].power_range = -10
Expand All @@ -135,23 +141,14 @@ def create(runcard_path=RUNCARD):
# Instantiate local oscillators
local_oscillators = [
LocalOscillator(f"lo_{kind}", None)
for kind in ["readout"] + [f"drive_{n}" for n in range(4)]
for kind in ["readout"] + [f"drive_{n}" for n in range(3)]
]

local_oscillators.append(ERA("twpa_fixed", TWPA_ADDRESS))
# TWPA Parameters
local_oscillators[-1].frequency = 6_690_000_000
local_oscillators[-1].power = -5.6

# Set Dummy LO parameters (Map only the two by two oscillators)
local_oscillators[0].frequency = 5_500_000_000 # For SG0 (Readout)
local_oscillators[1].frequency = 4_200_000_000 # For SG1 and SG2 (Drive)
local_oscillators[2].frequency = 4_600_000_000 # For SG3 and SG4 (Drive)
local_oscillators[3].frequency = 4_800_000_000 # For SG5 and SG6 (Drive)
local_oscillators.append(SGS100A("TWPA", TWPA_ADDRESS))

# Map LOs to channels
ch_to_lo = {
"L2-7": 0,
"L3-31": 0,
"L4-15": 1,
"L4-16": 1,
"L4-17": 2,
Expand All @@ -164,31 +161,34 @@ def create(runcard_path=RUNCARD):

# create qubit objects
runcard = load_runcard(runcard_path)
qubits, pairs = load_qubits(runcard)
qubits, couplers, pairs = load_qubits(runcard)
settings = load_settings(runcard)

# assign channels to qubits and sweetspots(operating points)
for q in range(0, 5):
qubits[q].feedback = channels["L3-31"]
qubits[q].readout = channels["L2-7"]
qubits[q].readout = channels["L3-31"]
qubits[q].feedback = channels["L2-7"]

for q in range(0, 5):
qubits[q].drive = channels[f"L4-{15 + q}"]
qubits[q].flux = channels[f"L4-{6 + q}"]
qubits[q].twpa = channels[f"L3-32"]
channels[f"L4-{6 + q}"].qubit = qubits[q]

# assign channels to couplers and sweetspots(operating points)
for c in range(0, 2):
qubits[f"c{c}"].flux = channels[f"L4-{11 + c}"]
channels[f"L4-{11 + c}"].qubit = qubits[f"c{c}"]
for c in range(3, 5):
qubits[f"c{c}"].flux = channels[f"L4-{10 + c}"]
channels[f"L4-{10 + c}"].qubit = qubits[f"c{c}"]

# assign qubits to couplers
for c in itertools.chain(range(0, 2), range(3, 5)):
qubits[f"c{c}"].flux_coupler = [qubits[c]]
qubits[f"c{c}"].flux_coupler.append(qubits[2])

for c, coupler in enumerate(couplers.values()):
coupler.flux = channels[f"L4-{11 + c}"]
# Is this needed ?
# channels[f"L4-{11 + c}"].qubit = qubits[f"c{c}"]
instruments = {controller.name: controller}
instruments.update({lo.name: lo for lo in local_oscillators})
settings = load_settings(runcard)
return Platform("IQM5q", qubits, pairs, instruments, settings, resonator_type="2D")
instruments = load_instrument_settings(runcard, instruments)
return Platform(
"IQM5q",
qubits,
pairs,
instruments,
settings,
resonator_type="2D",
couplers=couplers,
)
Loading

0 comments on commit b7b3cbe

Please sign in to comment.