Skip to content

Add detector error model sampling with error recording - #300

Merged
Strilanc merged 5 commits into
mainfrom
crunchdown0
Jul 25, 2022
Merged

Strilanc merged 5 commits into
mainfrom
crunchdown0

Conversation

@Strilanc

@Strilanc Strilanc commented Jul 25, 2022

Copy link
Copy Markdown
Collaborator

Example:

import stim
sampler = stim.DetectorErrorModel("""
    error(0.125) D0
    error(0.25) D1
""").compile_sampler()
det_data, obs_data, err_data = noisy_sampler.sample(shots=100, return_errors=True, bit_packed=True)

Python changes:

  • Add stim.DetectorErrorModel.flattened
  • Add stim.DetectorErrorModel.rounded
  • Add stim.DetectorErrorModel.compile_sampler
  • Add stim.CompiledDemSampler class
  • Add stim.CompiledDemSampler.sample
  • Add stim.CompiledDemSampler.sample_write

Doc hanges:

  • Fix documented type signatures of to_file/from_file methods
  • Stop listing deprecated methods in the API reference

C++ changes:

  • Move more pybind-related methods into the stim_pybind namespace
  • Add stim::MeasureRecordReader::read_into_table_with_major_shot_index
  • Add stim::MeasureRecordReader::read_into_table_with_minor_shot_index
  • Add stim::read_file_data_into_shot_table
  • Add stim::RaiiFile(RaiiFile&&)
  • Add stim::DemSampler
  • Add stim sample_dem command line command
  • Add --err_out, --err_out_format, --replay_err_in, --replay_err_in_format flags for stim sample_dem
  • Add some cleanup flexibility to stim::RaiiFile (manual done, manual donotclose)
  • Add read_contents/write_contents to test utility RaiiTempNamedFile
  • Change stim::DetectorErrorModel::rounded to only round probabilities not coordinates

Fixes #80
Fixes #297

Strilanc added 5 commits July 24, 2022 15:19
- Add stim.DetectorErrorModel.flattened
- Add stim.DetectorErrorModel.rounded
- Fix documented type signatures of to_file/from_file methods
- Change stim::DetectorErrorModel::rounded to only round probabilities not coordinates
- Add some cleanup flexibility to `stim::RaiiFile` (manual done, manual donotclose)
- Add `stim::DemSampler`
- Add read_contents/write_contents to test utility `RaiiTempNamedFile`
- Add `stim::MeasureRecordReader::read_into_table_with_minor_shot_index`
- Add `stim::read_file_data_into_shot_table`
- Add `stim::RaiiFile(RaiiFile&&)`
- Add `--err_out`,`--err_out_format`,`--replay_err_in`,`--replay_err_in_format` floats to `stim sample_dem`
- Add error recording and replaying to DemSampler
- Move more pybind methods into stim_pybind
- Add `stim.DetectorErrorModel.compile_sampler`
- Add `stim.DemSampler.sample`
- Add `stim.DemSampler.sample_write`
@Strilanc
Strilanc enabled auto-merge (squash) July 25, 2022 07:54
@Strilanc
Strilanc merged commit 6c220a7 into main Jul 25, 2022
@Strilanc
Strilanc deleted the crunchdown0 branch July 25, 2022 08:06
@shi-jie-samuel-tan

Copy link
Copy Markdown

Hi Craig, is this function stim.DetectorErrorModel.compile_sampler now available? Having the error data would be useful!

@Strilanc

Copy link
Copy Markdown
Collaborator Author

@SamuelTan97 If you install the latest development version (pip install stim==1.10.dev1658959700), it is available there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add stim.DetectorErrorModel.flattened Add a sample method to detector error model

2 participants