qat.core.Schedule

class qat.core.Schedule(drive=None, tmax=1.0, tname='t', gamma_t=None)

Schedules encode time-dependent Hamiltonians, described by the general expression:

\[H(t) = \sum_i \lambda_i(t) H_i\]

with \(H_i\) a Hermitian operator. The \(H\) will be evolved for a time tmax. From a Schedule one can create a Job via the to_job() method and send it to a dedicated analog QPU for execution.

Parameters
  • drive (Observable or list<tuple<Variable (or float) – Observable>>): the time dependent Hamiltonian to be driven.

  • tmax (Variable or float) – the time at which the evolution halts. Default is 1.0.

dump(fname)

Dumps the schedule in a binary file

Parameters

fname (str) – the file name

get_variables()

Returns the sorted list of all variables appearing in the schedule and its constituents

classmethod load(fname)

Loads a schedule from a binary file.

Parameters

fname (str) – the file name

Returns

a schedule

Return type

Schedule

to_job(job_type='SAMPLE', qubits=None, observable=None, psi_0=None, nbshots=0, aggregate_data=True, amp_threshold=9.094947017729282e-13, **kwargs)

Generates a Job containing the schedule and some post processing information.

Parameters
  • job_type (string, optional) – possible values are “SAMPLE” for computational basis sampling of all (or some) qubits, or “OBS” for returning the expectation value of an Observable.

  • qubits (list<int> or list<QRegister>, optional) – the list of qubits to measure (in “SAMPLE” mode). Defaults to None, meaning all qubits are to be measured.

  • observable (Observable, optional) – an observable (in “OBS” mode) the expectation value of which will be returned.

  • psi_0 (string or np.ndarray optional) – initial state of the processor. If of type str, it is the bitstring of length nqbits encoding a computational basis state. One can also use ‘+’ and ‘-’ to represent the respective superposition states, so a six-qubit input may look like ‘1+-01+’. If of type ndarray or list<ComplexNumber>, it is a length 2^nqbits array containing the complex amplitudes of the input state. Defaults to None (i.e |00..0>).

  • nbshots (int, optional) – The number of shots to perform. Defaults to zero in which case the convention is that the QPU should do its best: a quantum processor will use the largest amount of shots authorized by its configuration, while a simulator will try to output all the possible states contained in the final distribution, together with their probabilities (and possibly amplitudes) as if it did infinitely many executions.

  • aggregate_data (bool, optional) – if set to True, and nbshots is not zero, the samples will be aggregated and their probability field will be used to store their observed frequencies of apparition. Defaults to True.

  • amp_threshold (double, optional) – amplitude threshold under which states are not returned in the result structure. Useful to prune states that are unlikely to be measured out of the returned samples. Defaults to 1/2^40.