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

Add option to run emulator in Qibocal #1103

Merged
merged 8 commits into from
Mar 17, 2025
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
2 changes: 1 addition & 1 deletion platforms/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example platforms

In this folder there are a few example platforms that can be used with Qibocal. To use these platforms, `platforms` folder needs to be added to `QIBOLAB_PLATFORMS` environment variable. If the qibocal directory is cloned in the `HOME` directory this can be done with
In this folder there are a few example platforms that can be used with Qibocal. To use these platforms `platforms` folder needs to be added to `QIBOLAB_PLATFORMS` environment variable. If the qibocal directory is cloned in the `HOME` directory this can be done with

```bash
export QIBOLAB_PLATFORMS=~/qibocal/platforms
Expand Down
32 changes: 32 additions & 0 deletions platforms/emulator1q/calibration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"single_qubits": {
"0": {
"resonator": {
"bare_frequency": 0.0,
"dressed_frequency": 5200000000.0,
"depletion_time": 0
},
"qubit": {
"frequency_01": 5000000000.0,
"frequency_12": 4700000000.0,
"maximum_frequency": 5000000000.0,
"asymmetry": 0.0,
"sweetspot": 0.0
},
"readout": {
"fidelity": 0.0,
"ground_state": [
0.0,
1.0
],
"excited_state": [
1.0,
0.0
]
},
"rb_fidelity": null
}
},
"two_qubits": {
}
}
115 changes: 115 additions & 0 deletions platforms/emulator1q/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"settings": {
"nshots": 1024,
"relaxation_time": 0
},
"configs": {
"emulator/bounds": {
"kind": "bounds",
"waveforms": 1000000,
"readout": 50,
"instructions": 200
},
"hamiltonian":{
"single_qubit": {
"0": {
"frequency": 5000000000,
"t1": 1000,
"t2": 1500
}
},
"kind": "hamiltonian"
},
"0/drive": {
"kind": "iq",
"frequency": 5000000000
},
"0/probe": {
"kind": "iq",
"frequency": 5200000000.0
},
"0/acquisition": {
"kind": "acquisition",
"delay": 0.0,
"smearing": 0.0,
"threshold": 0.0,
"iq_angle": 0.0,
"kernel": "k05VTVBZAQB2AHsnZGVzY3InOiAnPGY4JywgJ2ZvcnRyYW5fb3JkZXInOiBGYWxzZSwgJ3NoYXBlJzogKDEwLCksIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAp5sDfS7uHlP2DIMKNvnKc/gCqN8KV/pT94FQCYYJC3PzSbwfi/894/APwg6C61rj8MSN3blizAP2ha9unQYsM/+BFjHTxcwT+gXaJazvbpPw=="
}
},
"native_gates": {
"single_qubit": {
"0": {
"RX": [
[
"0/drive",
{
"duration": 100,
"amplitude": 0.44,
"envelope": {
"kind": "gaussian",
"rel_sigma": 0.2
},
"relative_phase": 0.0,
"kind": "pulse"
}
]
],
"RX90": [
[
"0/drive",
{
"duration": 100,
"amplitude": 0.178,
"envelope": {
"kind": "gaussian",
"rel_sigma": 0.2
},
"relative_phase": 0.0,
"kind": "pulse"
}
]
],
"RX12": [
[
"0/drive12",
{
"duration": 40.0,
"amplitude": 0.005,
"envelope": {
"kind": "gaussian",
"rel_sigma": 0.2
},
"relative_phase": 0.0,
"kind": "pulse"
}
]
],
"MZ": [
[
"0/acquisition",
{
"kind": "readout",
"acquisition": {
"kind": "acquisition",
"duration": 2000.0
},
"probe": {
"duration": 2000.0,
"amplitude": 0.1,
"envelope": {
"kind": "gaussian_square",
"rel_sigma": 0.2,
"width": 0.75
},
"relative_phase": 0.0,
"kind": "pulse"
}
}
]
],
"CP": null
}
}
}
}
35 changes: 35 additions & 0 deletions platforms/emulator1q/platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import pathlib

from qibolab import ConfigKinds
from qibolab._core.components import IqChannel
from qibolab._core.instruments.emulator.emulator import EmulatorController
from qibolab._core.instruments.emulator.hamiltonians import HamiltonianConfig
from qibolab._core.platform import Platform
from qibolab._core.qubits import Qubit

FOLDER = pathlib.Path(__file__).parent

ConfigKinds.extend([HamiltonianConfig])


def create() -> Platform:
"""Create a dummy platform using the dummy instrument."""
qubits = {}
channels = {}

for q in range(1):
qubits[q] = qubit = Qubit.default(q)
channels |= {
qubit.drive: IqChannel(mixer=None, lo=None),
}

# register the instruments
instruments = {
"dummy": EmulatorController(address="0.0.0.0", channels=channels),
}

return Platform.load(
path=FOLDER,
instruments=instruments,
qubits=qubits,
)