-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add script to recompile the ECC sets (#514)
- Moves the loose ECC files into `test_files/eccs` - Adds a `just recompile-eccs` command / script to regenerate the `.rwr` files. Note that the compilation is not deterministic, so we should avoid running it unless needed to avoid bloating the git history. --------- Co-authored-by: Douglas Wilson <douglas.wilson@quantinuum.com>
- Loading branch information
Showing
13 changed files
with
32,426 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
# Compiled ECC files | ||
*.rwr binary |
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,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script calls `compile-rewriter` to recompile all ECC sets in the | ||
# `test_files/eccs/` directory. | ||
# | ||
# Note that the output is not deterministic, so the resulting `.rwr` will always | ||
# be different even if the input and the compiler are the same. | ||
set -euo pipefail | ||
|
||
# Get the directory of this script | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ECCS_DIR="$DIR/../test_files/eccs" | ||
|
||
# Command to call compile-rewriter with cargo | ||
COMPILE_REWRITER="cargo run --release -p compile-rewriter --" | ||
|
||
# Compile all json files into `.rwr` | ||
for ecc in $ECCS_DIR/*.json; do | ||
echo "-------- Compiling $ecc" | ||
$COMPILE_REWRITER -i "$ecc" -o "${ecc%.json}.rwr" | ||
done | ||
|
||
# Additional hard-coded step: | ||
# The python package contains a copy of the nam_6_3 ecc, | ||
# which must be manually copied. | ||
PY_ECCS_DIR="$DIR/../tket2-py/tket2/data" | ||
nam_6_3="$ECCS_DIR/nam_6_3.rwr" | ||
PY_NAM_6_3="$PY_ECCS_DIR/nam_6_3.rwr" | ||
|
||
echo "Copying $nam_6_3 to $PY_NAM_6_3" | ||
cp -f "$nam_6_3" "$PY_NAM_6_3" | ||
|
||
echo "Done!" |
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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