microsoft / microsoft/Qcodes

Measurement / Experiment container

Open
#128 8 comments 0 reactions 0 assignees View on GitHub
discussion enhancement
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

Right now what we can do, and what is done in the notebook, to take a measurement is:

``` Python
qc.Loop(
...
).run( ... )
```

This is getting too restricted, we could start overloading the `run()` even more with all kinds of stuff but I have the feeling it will get too big.
There are a lot of things I might want to do. And i want to propose some kind of measurement container. That can take care of settings, metadata, storage, and notes and others.

This also encourages reusing loops, instead of `loop(...).run(...)`

I'd like to run a measurement like this.

``` Python
my_loop = qc.loop(c0[1:2:3])
your_loop = qc.loop(c0[1:2:3])

# change stuff when I dont want defaults
exp = qc.Measurement(
location = 'somewhere',
file_format = 'hdf5',
snapshot = True,
snapshot_update = False,
default_measurement = [p.ampl, p.phase]
)

# add metadata to this measurement
meta = {
'sample': 'xyz'
'logbook': {'paper': 'page 12',
'online': '//link'}
'notes': "This Measurement is really important!"
}
exp.add_info( meta )

# Define default / intended plots for this measurement
exp.add_plot(x=c0, y = m.amplitude, ...)
exp.add_plot(x=c0, y = m.amplitude.diff(), ..)

# set the loop that is actually run
exp.set_loop( my_loop )

# run the measurement:
# - Prepare whatever
# - Genereate and save the snapshot + metadata
# - Run the loop
exp.run()

exp.plot()
```

@alexcjohnson and others, what do you think about this?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing qc.Loop(...).run(...) usage shown in the issue and the surrounding discussion about a Measurement container. The scope requires an agreed design for settings, metadata, storage, notes, plots, loops, snapshots, and run behavior before implementation; done means that design is accepted and its required behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.