From dea9c0f35f14833c76e2d0f7b8d796a459af4222 Mon Sep 17 00:00:00 2001 From: jamesETsmith Date: Thu, 11 Jul 2024 16:33:03 -0400 Subject: [PATCH] [feature/pre-commit] Removing scratch scripts and adding dev setup instructions to README --- README.md | 14 +++++++++----- examples/make_strings.py | 38 -------------------------------------- 2 files changed, 9 insertions(+), 43 deletions(-) delete mode 100644 examples/make_strings.py diff --git a/README.md b/README.md index db1ad04..15a5b51 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,20 @@ - Tested Compilers GCC@12, LLVM@17, LLVM@18 - Python >= 3.10 -### Dev Requirements -- [`pre-commit`](https://pre-commit.com/) - +## Developer Setup -### Developer Standards +### Dev Requirements - C/C++: `clang-format` defaults -- Python: `ruff` lint/format +- Python: `ruff` lint/format, [`pre-commit`](https://pre-commit.com/) - CMake: `cmake-format` +> **You need to install the `pre-commit` hooks to ensure they run before you commit code.** + +```shell +# From root project dir +pre-commit install # installs the checks as pre-commit hooks +``` ## Build and Test diff --git a/examples/make_strings.py b/examples/make_strings.py deleted file mode 100644 index dc2fe4a..0000000 --- a/examples/make_strings.py +++ /dev/null @@ -1,38 +0,0 @@ -from itertools import combinations, product - -qubits = 5 -weight = 2 - -strings = [] -nontrivial_matrix_elements = list(product(["X", "Y", "Z"], repeat=weight)) -for indices in combinations(range(qubits), weight): # n(n-1)/2 terms - for elements in nontrivial_matrix_elements: - pauli_string = [] - for qbit in range(qubits): - for el_position, i in enumerate(indices): - if i == qbit: - pauli_string.append(elements[el_position]) - break - else: - pauli_string.append("I") - strings.append("".join(pauli_string)) - -print(strings) - -( - "XXIII", - "XYIII", - "XZIII", - "YXIII", - "YYIII", - "YZIII", - "ZXIII", - "ZYIII", - "ZZIII", - "XIXII", - "XIYII", - "XIZII", - "YIXII", - "YIYII", - "YIZII", -)