flamingpy.simulations.ec_monte_carlo¶
- flamingpy.simulations.ec_monte_carlo(trials, code_instance, noise_instance, decoder, decoder_args, world_comm=None, mpi_rank=0, mpi_size=1)[source]¶
Run Monte Carlo simulations of error-correction for the given code.
Given a code object code, a noise parameter delta, and a swap-out probably p_swap, run a number of Monte Carlo simulations equal to trials of the complete error-corection procedure.
- Parameters
trials (int) – the number of trials.
code_instance (code object) – the initialized qubit code
noise_instance (noise object) – the initialized noise layer (CVLayer, CVMacroLayer, or IidNoise)
decoder (str) – the decoding algorithm (“MWPM” or “UF”)
decoder_args (dict) – arguments for the decoder (such as weight options)
world_comm – arguments for the MPI library.
mpi_rank – arguments for the MPI library.
mpi_size – arguments for the MPI library.
- Returns
the number of errors.
- Return type
errors (integer)