Simulation Objects

class py_qcode.Simulation(lattice, dual_lattice, error_model, code, decoder, logical_operators, n_trials)

Simulation is the top-level class for py_qcode, the user is meant to set up, execute and save results using these objects.

Parameters:
  • error_model (py_qcode:ErrorModel, input) – A description of the errors to be applied independently to the qubits of lattice.
  • code (py_qcode.ErrorCorrectingCode, input) – An error-correcting code which translates errors on a lattice to syndromes on the dual lattice.
  • decoder (py_qcode.Decoder, input) – A protocol for inferring errors given syndromes.
  • n_trials (integer, input) – a number of simulations to be performed in series. This can be used to organize batch jobs so that one can submit more than one simulation per job.
  • true_coset (str, output) – The actual coset to which the random error applied in the simulation belongs.
  • inferred_coset – The coset assigned by the error-correcting code during the simulation.
run()

The main routine in this library, follows the recipe n_trials times in series:

  • Apply the error model to the primary lattice, assigning values to the error attributes of the py_qcode.Point objects within.
  • Obtain the true coset of the error with respect to the py_qcode.ErrorCorrectingCode being used.
  • Perform a measurement, using the attributes of the error-correcting code to generate syndromes on the dual lattice.
  • Infer the coset of the error by acting the decoder on the dual lattice.
  • Record both cosets.
save(filename)

Previous topic

py_qcode: decoding topological error-correcting codes in Python

Next topic

Points and Lattices

This Page