-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial det/obs support to crumble, plus other polish (#773)
Tagalong Stim diagram improvements: - Change 3d matchgraph diagrams to use a slightly more 3d indicator for detectors - Change matchgraph diagrams to not decompose if decomposition produces any errors - Change matchgraph diagrams to draw hypererrors that flip an observable in purple, instead of in blue Crumble improvements: - Fix hitting 1-9 on an MPP operation not inferring that it should mark every target of the operation in their basis - Add initial support for detectors - `d+#` to turn a marked flow into a detector - `o+#` to turn a marked flow into an observable - Draw detecting regions of dets and obs as small squares on qubits at each moment in the timeslice, and between moment in the timeline - `j+#` to pick an arbitrary det or obs with a detection region going through the current selection, and turn it into a - `k+#` to add markers to dissipative gates overlapping the propagating flow in the current layer marked flow - Fix feedback operations not being correctly ignored, or causing non-feedback parts of an operation to be discarded - Polish the scrubber - Move it to run horizontally along the timeline - Add visual hints of what's in each layer - Polish the visuals - Improve the indication of marker flows beyond 4 - Make timeline view justify left when near start of circuit, and justify right when near end of circuit, to always show as much information as possible - Only show timeline-to-timeslice qubit position indicators when hovering over that qubit in the timeline - Fade out unused qubits more - Set the default polygon alpha lower, so they are more faded - Fix several instances of fuzzy drawing due to off-by-0.5 coordinates - Draw example polygons and markers in the toolbox to better indicate what `P` and `#` do - Add quality of life controls - Fix needing to often hit cltr+z twice in order to undo once - Fix clicking on an example circuit link resulting in the undo history being lost - Press `F` to flip two qubit gates (e.g. exchange target and control) - Moved `C_XYZ` gate from `F` to `c+t` - Press `G` to reverse the order of layers starting from the current layer ending at first empty layer - Press `>`, `<`, `^`, `v` to translate coordinates in the indicated direction - Press `.` to translate circuit downright one half step - Press `home`/`end` to jump to start/end of circuit - Press `shift+q/e` to jump 5 layers at a time - Added more example circuits, and moved examples behind a "show examples" button - Fix frame gate methods targeting indices instead of targets - Add frame undo gate methods - Fixes #771 - Fixes #715 - Fixes #738
- Loading branch information
Showing
59 changed files
with
2,836 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,7 +325,7 @@ jobs: | |
- run: diff <(dev/gen_known_gates_for_js.sh) glue/crumble/test/generated_gate_name_list.test.js | ||
- run: python doc/stim.pyi | ||
- run: npm install -g [email protected] [email protected] | ||
- run: diff <(dev/regen_crumble_to_cpp_string_write_to_stdout.sh) src/stim/diagram/crumble_data.cc | ||
- run: diff <(dev/compile_crumble_into_cpp_string_file.sh) src/stim/diagram/crumble_data.cc | ||
- run: pip install -e glue/sample | ||
- run: diff <(python dev/gen_sinter_api_reference.py -dev) doc/sinter_api.md | ||
test_generated_file_lists_are_fresh: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @param {!Iterable<TItem> | !Iterator<TItem>}items | ||
* @param {!function(item: TItem): TKey} func | ||
* @returns {!Map<TKey, !Array<TItem>>} | ||
* @template TItem | ||
* @template TKey | ||
*/ | ||
function groupBy(items, func) { | ||
let result = new Map(); | ||
for (let item of items) { | ||
let key = func(item); | ||
let group = result.get(key); | ||
if (group === undefined) { | ||
result.set(key, [item]); | ||
} else { | ||
group.push(item); | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
export {groupBy}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {assertThat, test} from "../test/test_util.js" | ||
import {groupBy} from "./seq.js" | ||
|
||
test("seq.groupBy", () => { | ||
assertThat(groupBy([], e => e)).isEqualTo(new Map([])) | ||
assertThat(groupBy([2, 3, 5, 11, 15, 17, 2], e => e % 5)).isEqualTo(new Map([ | ||
[1, [11]], | ||
[2, [2, 17, 2]], | ||
[3, [3]], | ||
[0, [5, 15]], | ||
])) | ||
}); |
Oops, something went wrong.