qstone.apps package

Submodules

qstone.apps.PyMatching module

Defines the two steps of PyMatching jobs

class qstone.apps.PyMatching.PyMatching(cfg: dict)[source]

Bases: Computation

PyMatching computation class.

CFG_STRING: str | None = '\n    {\n      "cfg":\n      {\n        "num_required_qubits" : 10,\n        "repetitions": 2\n      }\n    }\n    '
COMPUTATION_NAME: str = 'PyMatching'
SCHEMA: DataFrameSchema = <Schema DataFrameSchema(columns={'repetitions': <Schema Column(name=repetitions, type=DataType(int64))>}, checks=[], parsers=[], index=None, dtype=None, coerce=False, strict=False, name=None, ordered=False, unique=None, report_duplicates=all, unique_column_names=False, add_missing_columns=False, title=None, description=None, metadata=None, drop_invalid_rows=False)>
generate_synthetic_data(data_path: str)[source]

Generates synthetic data and stores them in data_path

post(datapath: str)[source]

Runs the postprocessing analysis using PyMatching decoder over a given input file

Parameters:

datapath – path location to write circuit

Returns: number of errors detected

pre(datapath: str)[source]

Prepare and write circuit for QEC experiment

Parameters:

datapath – path location to write circuit

Returns: path location of written circuit, without extension

run(datapath: str, connection: Connector)[source]

Runs the Quantum circuit N times

Parameters:
  • datapath – path location to write circuit

  • connection – connector object to run circuit

  • shots – number of shots to be executed

Returns: path location of syndromes file

qstone.apps.RB module

RB computations steps.

class qstone.apps.RB.RB(cfg: dict)[source]

Bases: Computation

Type 1 computation class.

CFG_STRING: str | None = '\n    {\n      "cfg":\n      {\n         "num_required_qubits" : 2,\n         "repetitions": 2\n      }\n    } \n    '
COMPUTATION_NAME: str = 'RB'
SCHEMA: DataFrameSchema = <Schema DataFrameSchema(columns={'repetitions': <Schema Column(name=repetitions, type=DataType(int64))>}, checks=[], parsers=[], index=None, dtype=None, coerce=False, strict=False, name=None, ordered=False, unique=None, report_duplicates=all, unique_column_names=False, add_missing_columns=False, title=None, description=None, metadata=None, drop_invalid_rows=False)>
post(datapath: str)[source]

Runs the processing of the randomised benchmarking using the data provided by datapath

pre(datapath: str)[source]

Generates the circuits required to extract the randomised benchmarking circuits.

run(datapath: str, connection: Connector)[source]

Runs the Quantum circuit N times

Parameters:
  • datapath – path location to write circuit

  • connection – connector object to run circuit

  • shots – number of shots to be executed

qstone.apps.VQE module

VQE computations steps.

class qstone.apps.VQE.VQE(cfg: dict)[source]

Bases: Computation

VQE computation class.

CFG_STRING: str | None = '\n    {\n      "cfg":\n      {\n        "num_required_qubits" : 4,\n        "repetitions" : 10,\n        "iterations" : 10,\n        "compute_duration" : 1\n      }\n    }\n    '
COMPUTATION_NAME: str = 'VQE'
SCHEMA: DataFrameSchema = <Schema DataFrameSchema(columns={'repetitions': <Schema Column(name=repetitions, type=DataType(int64))>, 'iterations': <Schema Column(name=iterations, type=DataType(int64))>, 'compute_duration': <Schema Column(name=compute_duration, type=DataType(int64))>}, checks=[], parsers=[], index=None, dtype=None, coerce=False, strict=False, name=None, ordered=False, unique=None, report_duplicates=all, unique_column_names=False, add_missing_columns=False, title=None, description=None, metadata=None, drop_invalid_rows=False)>
post(datapath: str)[source]

Phase not required

pre(datapath: str)[source]

Phase not required

run(datapath: str, connection: Connector)[source]

Runs the Quantum circuit N times

qstone.apps.computation module

QPU computation class and configuration dataclass

class qstone.apps.computation.Computation(cfg: Dict)[source]

Bases: ABC

Abstract class for a QPU computation. To be ovverriden by implemented jobs.

Parameters:
  • cfg – Computation configuration dictionary. Key value pairs describing

  • data. (the script)

BASEPATH: str = '/home/runner/work/QStone/QStone/qstone/apps/..'
CFG_PATH: str | None = None
CFG_STRING: str | None = None
COMPUTATION_NAME: str
SCHEMA: DataFrameSchema
dump_cfg() str[source]

Serializes computation script information into JSON string.

Returns json string representation of computation configuration.

classmethod from_json(path: str | None = None)[source]

Factory method for creating computation via JSON configuration.

Parameters:

path – Path to computation configuration file

abstract post(datapath)[source]

QPU computation postprocessing step

abstract pre(datapath: str) None[source]

QPU computation preprocessing step

property qpu_cfg

qpu_cfg getter

abstract run(datapath: str, connection: Connector)[source]

QPU computation circuit run step

Module contents

QPU Computation registry

qstone.apps.get_computation_src(src: str)[source]

Extracts the computation src either from the standard set or from the user