[WIP] Add support for comparing DEMs up to instruction ordering#1042
[WIP] Add support for comparing DEMs up to instruction ordering#1042abbrazi wants to merge 1 commit intoquantumlib:mainfrom
Conversation
The current `==` overload of the `DetectorErrorModel` only returns true if the DEMs have the same instruction ordering. It is sometimes useful to be able to compare two DEMs for equality when this is not the case, so I implemented an `equal_up_to_instruction_ordering` member function. I opted not to change the `==` operator because (a) checking for equality up to instruction ordering requires sorting so turns an O(n) op into an O(n log n) op; and (b) it's possible some of the backend simulation code depends on the ordering constraint. Signed-off-by: Abbas Bracken Ziad <abbas.ziad25@imperial.ac.uk>
65e7973 to
f505004
Compare
|
Two major problems with this method as currently implemented.
and and a simple solution would be to first flatten the dem, but that would make the method take far too long when applied to circuits with high repetition counts. There are a few exceptions, but basically all methods in stim are efficient when applied to high-loop-count circuits. This method would also need to meet that bar. |
|
Yeah I guess this is a flat world theory :D |
The current
==overload of theDetectorErrorModelonly returns true if the DEMs have the same instruction ordering. It is sometimes useful to be able to compare two DEMs for equality when this is not the case, so I implemented anequal_up_to_instruction_orderingmember function. I opted not to change the==operator because (a) checking for equality up to instruction ordering requires sorting so turns an O(n) op into an O(n log n) op; and (b) it's possible some of the backend simulation code depends on the ordering constraint.