Manifests and records¶
Write a manifest to say what to send. The app writes a record of what was sent and what came back. The app never changes a manifest, and you never change a record.
The manifest¶
One JSON file, next to the circuit files it names:
{"format": "qdevices/1", "site": "euroqexa", "machine": "EQE1", "project": "MY-PROJECT",
"jobs": [{"order": 1, "name": "X", "file": "X.qasm", "sha256": "...", "shots": 100,
"options": {"no_modify": false}}]}
Key |
What it holds |
|---|---|
|
|
|
|
|
the machine name at the site: |
|
your project; it must be listed in |
|
VLQ only, and needed there: the LEXIS project the device time is booked on, and the resource (VLQ (IT4Innovations)) |
|
the name of the run folder of the records; when absent, the name of the folder of the manifest |
|
optional, Euro-Q-Exa: the layout the texts were written for (The layout pin) |
|
the list of jobs, below |
any other key |
kept, and copied to the start line of the record (the example |
Key of a job |
What it holds |
|---|---|
|
the whole numbers 1 to N, in sequence, without gaps (not |
|
letters, digits, |
|
a file name next to the manifest (no folder part): one circuit, in the form the site takes |
|
the SHA-256 of the file, 64 lower-case hex digits |
|
a whole number of 1 to 1,000,000,000 |
|
optional: the options of the site. Euro-Q-Exa has |
any other key |
kept; a rules file sees it (Rules) |
Get the SHA-256 with shasum -a 256 X.qasm (macOS) or sha256sum X.qasm (Linux). The dry run prints the
SHA-256 it finds when it differs. The app checks the file again just before it is sent: a file that has
changed is not sent.
The layout pin¶
Run qdevices check euroqexa --live --manifest FILE. It prints the layout of the machine and the line that
pins it, "layout": {"layout_sha256": "...", "qubits": N, "pairs": M}: put that line in the manifest. The
dry run compares the pin with the saved read (with no read, only its form), and a live call with its own
read. Another layout fails the check, and nothing is sent (Euro-Q-Exa (LRZ)); qubits and pairs are then
printed. When the machine has changed, a text may act on other qubits: read it again, check the texts
against the new layout, then pin it. A record that has sent jobs cannot go on with a changed manifest
(send in Commands).
layout_sha256 is the SHA-256, in hex, of one UTF-8 text: qubits=N;pairs=, then each coupled pair once
as a-b, the lower index first, the pairs sorted and joined by commas. For 3 qubits coupled 0-1 and 1-2:
qubits=3;pairs=0-1,1-2.
The records¶
Each run has its records in ~/.local/share/qdevices/records/<site>/<run>/, one run_<UTC>.jsonl each.
<run> is the run key of the manifest, or the name of its folder. Each event is one JSON line, synced
to disk before the next request (Live runs).
A line that was cut (for example by a crash), or is not UTF-8, is passed over. A resume prints each cut
line as a NOTE, with the job id it holds, which may be cut too. The resume line keeps them in
cut_lines: line, text (the first 120 characters), job_id and job_id_may_be_cut.
Line |
Written |
|---|---|
|
once, at the start: the version, the host, the path, device and inode of the record, the manifest and its SHA-256, the SHA-256 of each file, the jobs, the extra keys of the manifest, the fixed addresses of the site, and the rules file (The rules file in the record) |
|
at the start of each later call, with the rules file (The rules file in the record) |
|
the read of the machine before the first job of a call, and |
|
each verdict of a rule, with its |
|
before the first request of a job |
|
each step of a VLQ job (created, uploaded) and of its init job, before the next request; the |
|
the job id, as soon as the answer is read |
|
each state read while waiting; a missed poll (Live runs) when the kind of failure changes, with |
|
the counts and the seconds; for VLQ also |
|
a job the site refused, a job that failed, a VLQ job never submitted |
|
your decision with |
|
the end of a call before every order is final, with the reason and its kind |
|
the normal end of a call |
The reads¶
qdevices check SITE --live stores each read in ~/.local/share/qdevices/reads/<site>/read_<UTC>.json,
through the token filter (Tokens). A read of Euro-Q-Exa also holds layout_sha256 and pairs
beside qubits; a read of VLQ holds status, from the status file of the site (VLQ (IT4Innovations)). The list of
machines of Euro-Q-Exa (a check without --manifest) is stored as list_<UTC>.json; the dry run does
not take it.
Records of other runners¶
Give the record or its folder to qdevices runs or qdevices usage, or list it in older_records of the
config (Configuration). Listed records also count in the budget and the open-order check of a send
to their own site. A record of another site in a listed folder is passed over. A record whose site cannot
be told counts for each site that lists it.
In the records folder of the app, the app reads only its own records (
run_<UTC>.jsonl).Below a folder of
older_recordsor aPATH, it reads the files namedrun*.jsonl, and every other.jsonlfile whose first line is a start line. Give any other record by its own path.One
.jsonlfile below the folder that cannot be read (no read permission, a broken link, or a first line longer than 1 MiB) makes the whole folder unreadable, even if it is not a record. A call that sends to its site is then refused (Commands).Each record counts once, by its real path. Two copies in two folders count twice: list each record once.
An
expiredline of another runner (the site does not know the job) makes an order with no result final. It then counts atjob_seconds_limit.
The app never writes a record of another runner. A decision of qdevices resolve on it (Resolving an order, and a stale lock)
goes to ~/.local/share/qdevices/records/<site>/older_decisions.jsonl, as a resolved line that names
the record by the SHA-256 of its first line and of the lines read (start_sha256, lines,
lines_sha256), the job id (decided_id) and its path. The app adds the line when it reads the record
while the order is as decided on, also for a copy that starts with the same lines. The file of decisions
is never read as a record.