Repository: microsoft/qsharp
Pull request #1020 (2024-01-15 20:21:39)

Only comment memory benchmark results if there is a difference
With this change, our pipeline only comments about memory usage if there is a diff. If not, we omit the comment but log in the pipeline to confirm that there was no diff. I hope this reduces per-PR noise.

github-actions[bot]: ## Benchmark for eb1c2e9
  <details>
    <summary>Click to view benchmark</summary>

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Array append evaluation | 916.9±13.50µs | **876.6±7.59µs** | **-4.40%** |
| Array update evaluation | 991.3±7.12µs | **952.2±7.00µs** | **-3.94%** |
| Deutsch-Jozsa evaluation | 31.3±0.17ms | 31.2±0.20ms | -0.32% |
| Large file parity evaluation | **36.4±0.08ms** | 36.6±1.01ms | **+0.55%** |
| Large input file | **41.2±0.98ms** | 42.8±1.60ms | **+3.88%** |
| Standard library | **21.8±0.75ms** | 23.1±0.68ms | **+5.96%** |
| Teleport evaluation | 106.0±1.63µs | 105.5±2.20µs | -0.47% |

  </details>
  
github-actions[bot]: ## Benchmark for 7cd83b1
  <details>
    <summary>Click to view benchmark</summary>

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Array append evaluation | 875.7±8.83µs | **866.5±6.60µs** | **-1.05%** |
| Array update evaluation | 945.9±12.86µs | 939.2±7.82µs | -0.71% |
| Deutsch-Jozsa evaluation | 31.5±0.19ms | 31.4±1.22ms | -0.32% |
| Large file parity evaluation | 36.3±0.12ms | 36.4±0.19ms | +0.28% |
| Large input file | 37.9±0.68ms | 38.2±0.84ms | +0.79% |
| Standard library | 20.9±0.31ms | 20.9±0.42ms | 0.00% |
| Teleport evaluation | 105.9±1.85µs | 105.9±2.18µs | 0.00% |

  </details>
  
github-actions[bot]: _Change in memory usage detected by benchmark._
  ## Memory Report for c755e9dc76a6b5fc2f2a704090e908ff3425b83b
  | Test                        | This Branch | On Main  |
  |-----------------------------|-------------|----------|
  | compile core + standard lib | 15140473 bytes | 15140473 bytes |
github-actions[bot]: ## Benchmark for c755e9d
  <details>
    <summary>Click to view benchmark</summary>

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Array append evaluation | 872.6±5.93µs | 867.1±5.63µs | -0.63% |
| Array update evaluation | 942.5±5.76µs | 943.3±8.96µs | +0.08% |
| Deutsch-Jozsa evaluation | 31.4±0.31ms | 31.3±0.18ms | -0.32% |
| Large file parity evaluation | 36.2±0.10ms | 36.2±0.18ms | 0.00% |
| Large input file | 38.4±1.11ms | 38.0±0.86ms | -1.04% |
| Standard library | 20.8±0.24ms | 20.9±0.32ms | +0.48% |
| Teleport evaluation | 105.5±1.89µs | 106.0±1.88µs | +0.47% |

  </details>
  
github-actions[bot]: ## Benchmark for 8663a29
  <details>
    <summary>Click to view benchmark</summary>

| Test | Base         | PR               | % |
|------|--------------|------------------|---|
| Array append evaluation | 882.3±7.25µs | **872.7±7.97µs** | **-1.09%** |
| Array update evaluation | 952.8±4.31µs | 952.5±39.89µs | -0.03% |
| Deutsch-Jozsa evaluation | 31.5±0.17ms | 31.6±0.21ms | +0.32% |
| Large file parity evaluation | 36.3±0.15ms | 36.3±0.57ms | 0.00% |
| Large input file | 38.4±1.01ms | 39.0±1.21ms | +1.56% |
| Standard library | 20.9±0.63ms | 21.1±0.73ms | +0.96% |
| Teleport evaluation | 105.7±2.41µs | 105.3±1.94µs | -0.38% |

  </details>
  

Patch:
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 78aabf62..4433d185 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -11,6 +11,7 @@
 /npm @billti @cesarzc @minestarks
 /pip @billti @idavis @minestarks
 /playground @billti @cesarzc @minestarks
+/resource_estimator @billti @ivanbasov @swernli
 /samples @cesarzc @DmitryVasilevsky @sezna @swernli
 /vscode @billti @idavis @minestarks
 /wasm @billti @cesarzc @swernli
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 735f32f6..12156e60 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -178,13 +178,18 @@ jobs:
       - uses: actions/github-script@v6
         with:
           script: |
-            github.rest.issues.createComment({
-              issue_number: context.issue.number,
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              body: `## Memory Report for ${{ github.sha }}
-            | Test                        | This Branch | On Main  |
-            |-----------------------------|-------------|----------|
-            | compile core + standard lib | ${{ env.BRANCH_MEASUREMENT }} bytes | ${{ env.MAIN_MEASUREMENT }} bytes |`
-            })
+            if (${{ env.BRANCH_MEASUREMENT }} !== ${{ env.MAIN_MEASUREMENT }}) {
+              github.rest.issues.createComment({
+                issue_number: context.issue.number,
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                body: `_Change in memory usage detected by benchmark._
+              ## Memory Report for ${{ github.sha }}
+              | Test                        | This Branch | On Main  |
+              |-----------------------------|-------------|----------|
+              | compile core + standard lib | ${{ env.BRANCH_MEASUREMENT }} bytes | ${{ env.MAIN_MEASUREMENT }} bytes |`
+              })
+            } else {
+              console.log("no change in memory usage detected by benchmark");
+            }
         if: ${{ github.base_ref != null }}
diff --git a/Cargo.lock b/Cargo.lock
index 060472af..a7b215d3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -884,13 +884,11 @@ dependencies = [
  "criterion",
  "env_logger",
  "expect-test",
- "fasteval",
  "indoc",
  "log",
  "miette",
  "num-bigint",
  "num-complex",
- "probability",
  "qsc_ast",
  "qsc_codegen",
  "qsc_data_structures",
@@ -900,11 +898,7 @@ dependencies = [
  "qsc_hir",
  "qsc_passes",
  "qsc_project",
- "rand",
- "regex-lite",
  "rustc-hash",
- "serde",
- "serde_json",
  "thiserror",
 ]
 
@@ -1061,6 +1055,7 @@ dependencies = [
  "qsc_codegen",
  "qsc_project",
  "qsls",
+ "resource_estimator",
  "rustc-hash",
  "serde",
  "serde-wasm-bindgen",
@@ -1078,6 +1073,7 @@ dependencies = [
  "num-complex",
  "pyo3",
  "qsc",
+ "resource_estimator",
  "rustc-hash",
 ]
 
@@ -1208,6 +1204,26 @@ version = "0.8.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
 
+[[package]]
+name = "resource_estimator"
+version = "0.0.0"
+dependencies = [
+ "expect-test",
+ "fasteval",
+ "indoc",
+ "miette",
+ "num-bigint",
+ "num-complex",
+ "probability",
+ "qsc",
+ "rand",
+ "regex-lite",
+ "rustc-hash",
+ "serde",
+ "serde_json",
+ "thiserror",
+]
+
 [[package]]
 name = "rustc-demangle"
 version = "0.1.23"
diff --git a/Cargo.toml b/Cargo.toml
index b8f6eb57..069f3f22 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,6 +16,7 @@ members = [
     "language_service",
     "library/tests",
     "pip",
+    "resource_estimator",
     "wasm",
 ]
 resolver = "2"
diff --git a/compiler/qsc/Cargo.toml b/compiler/qsc/Cargo.toml
index b309e14d..a02b9c5e 100644
--- a/compiler/qsc/Cargo.toml
+++ b/compiler/qsc/Cargo.toml
@@ -25,14 +25,8 @@ qsc_fir = { path = "../qsc_fir" }
 qsc_hir = { path = "../qsc_hir" }
 qsc_passes = { path = "../qsc_passes" }
 qsc_project = { path = "../qsc_project", features = ["fs"] }
-rand = { workspace = true }
 rustc-hash = { workspace = true }
 thiserror = { workspace = true }
-probability = { workspace = true }
-regex-lite = { workspace = true }
-serde = { workspace = true, features = ["derive", "rc"] }
-serde_json = { workspace = true }
-fasteval = { workspace = true }
 
 [dev-dependencies]
 criterion = { workspace = true, features = ["cargo_bench_support"] }
diff --git a/compiler/qsc/src/interpret/stateful.rs b/compiler/qsc/src/interpret/stateful.rs
index 800cc70c..9ebaf982 100644
--- a/compiler/qsc/src/interpret/stateful.rs
+++ b/compiler/qsc/src/interpret/stateful.rs
@@ -7,8 +7,6 @@ mod tests;
 #[cfg(test)]
 mod stepping_tests;
 
-pub mod re;
-
 use super::debug::format_call_stack;
 use crate::{
     error::{self, WithStack},
diff --git a/katas/content/multi_qubit_systems/common.qs b/katas/content/multi_qubit_systems/common.qs
index b9c23165..5f583eb3 100644
--- a/katas/content/multi_qubit_systems/common.qs
+++ b/katas/content/multi_qubit_systems/common.qs
@@ -1,28 +1,21 @@
 namespace Kata.Verification {
-    open Microsoft.Quantum.Diagnostics;
+    open Microsoft.Quantum.Katas;
 
-    operation AssertEqualOnZeroState(
-        testImpl : (Qubit[] => Unit is Ctl),
-        refImpl : (Qubit[] => Unit is Adj+Ctl)) : Bool {
+    operation CheckEqualOnZeroState(
+        testImpl : (Qubit[] => Unit is Adj + Ctl),
+        refImpl : (Qubit[] => Unit is Adj + Ctl)) : Bool {
 
-        use qs = Qubit[3];
-        within {
-            H(qs[0]);
-        }
-        apply {
-            // apply operation that needs to be tested
-            Controlled testImpl([qs[0]], qs[1..2]);
-
-            // apply adjoint reference operation
-            Adjoint Controlled refImpl([qs[0]], qs[1..2]);
-        }
+        let isCorrect = CheckOperationsEquivalenceOnZeroStateStrict(testImpl, refImpl, 2);
 
-        // Implementation is correct when all qubits end up in |0⟩ state
-        let isCorrect = CheckAllZero(qs);
-        if not isCorrect {
-            Message("The prepared state is not the same as reference state.");
+        // Output different feedback to the user depending on whether the exercise was correct.
+        if isCorrect {
+            Message("Correct!");
+        } else {
+            Message("Incorrect.");
+            use target = Qubit[2]; // |00〉
+            ShowQuantumStateComparison(target, testImpl, refImpl);
+            ResetAll(target);
         }
-        ResetAll(qs);
         isCorrect
     }
 
diff --git a/katas/content/multi_qubit_systems/prepare_basis_state/verification.qs b/katas/content/multi_qubit_systems/prepare_basis_state/verification.qs
index 6873735f..a10b903e 100644
--- a/katas/content/multi_qubit_systems/prepare_basis_state/verification.qs
+++ b/katas/content/multi_qubit_systems/prepare_basis_state/verification.qs
@@ -1,4 +1,6 @@
 namespace Kata.Verification {
+    open Microsoft.Quantum.Katas;
+
     operation PrepareBasisState_Reference(qs : Qubit[]) : Unit is Adj + Ctl {
         X(qs[0]);
         X(qs[1]);
@@ -6,12 +8,6 @@ namespace Kata.Verification {
 
     @EntryPoint()
     operation CheckSolution() : Bool {
-        let isCorrect = AssertEqualOnZeroState(Kata.PrepareBasisState, PrepareBasisState_Reference);
-        if isCorrect {
-            Message("Correct!");
-        } else {
-            Message("Incorrect.");
-        }
-        return isCorrect;
+        CheckEqualOnZeroState(Kata.PrepareBasisState, PrepareBasisState_Reference)
     }
-}
\ No newline at end of file
+}
diff --git a/katas/content/multi_qubit_systems/prepare_superposition/index.md b/katas/content/multi_qubit_systems/prepare_superposition/index.md
index ac3f71b5..a5d20b42 100644
--- a/katas/content/multi_qubit_systems/prepare_superposition/index.md
+++ b/katas/content/multi_qubit_systems/prepare_superposition/index.md
@@ -1,8 +1,10 @@
 **Input:** A two-qubit system in the basis state $|00\rangle = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}$.
 
-**Goal:** Transform the system into the state $\frac{1}{\sqrt2}\big(|00\rangle - |01\rangle\big) = \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ -1 \\\ 0 \\\ 0 \end{bmatrix}$.
+**Goal:** Transform the system into the state $\frac{1}{\sqrt2}\big(|00\rangle - |10\rangle\big) = \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ 0 \\\ -1 \\\ 0 \end{bmatrix}$.
+
+> Note that the quantum states are represented in little-endian format For a state $|qs_1 qs_0\rangle$, the "first" qubit (`qs[0]` in a Q# qubit register) refers to the least-significant qubit $qs_0$, while the "second" qubit (`qs[1]` in a Q# register) refers to the most-significant qubit $qs_1$.
 
 <details>
     <summary><b>Need a hint?</b></summary>
-    Represent the target state as a tensor product $|0\rangle \otimes \frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big) = \begin{bmatrix} 1 \\\ 0 \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ -1 \end{bmatrix}$.
+    Represent the target state as a tensor product $\frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big) \otimes |0\rangle = \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ -1 \end{bmatrix} \otimes \begin{bmatrix} 1 \\\ 0 \end{bmatrix}$.
 </details>
diff --git a/katas/content/multi_qubit_systems/prepare_superposition/solution.md b/katas/content/multi_qubit_systems/prepare_superposition/solution.md
index 5179aaad..044ccfda 100644
--- a/katas/content/multi_qubit_systems/prepare_superposition/solution.md
+++ b/katas/content/multi_qubit_systems/prepare_superposition/solution.md
@@ -2,7 +2,7 @@
 $$ \begin{bmatrix} 1 \\\ 0 \\\ 0 \\\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\\ 0 \end{bmatrix} \otimes \begin{bmatrix} 1 \\\ 0 \end{bmatrix} = |0\rangle \otimes |0\rangle$$
 
 The goal state can be separated as follows:
-$$ \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ -1 \\\ 0 \\\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\\ 0 \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ -1 \end{bmatrix} = |0\rangle \otimes \frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big)$$
+$$ \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ 0 \\\ -1 \\\ 0 \end{bmatrix} = \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ -1 \end{bmatrix} \otimes \begin{bmatrix} 1 \\\ 0 \end{bmatrix} = \frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big) \otimes |0\rangle$$
 
 This means that the first qubit is already in the state we want it to be, but the second qubit needs to be transformed from the $ \begin{bmatrix} 1 \\\ 0 \end{bmatrix} $ into $ \frac{1}{\sqrt{2}}\begin{bmatrix} 1 \\\ -1\end{bmatrix}$ state.
 
diff --git a/katas/content/multi_qubit_systems/prepare_superposition/verification.qs b/katas/content/multi_qubit_systems/prepare_superposition/verification.qs
index ffb2ffb0..4ceac555 100644
--- a/katas/content/multi_qubit_systems/prepare_superposition/verification.qs
+++ b/katas/content/multi_qubit_systems/prepare_superposition/verification.qs
@@ -1,4 +1,6 @@
 namespace Kata.Verification {
+    open Microsoft.Quantum.Katas;
+
     operation PrepareSuperposition_Reference(qs : Qubit[]) : Unit is Adj + Ctl {
         X(qs[1]);
         H(qs[1]);
@@ -6,12 +8,6 @@ namespace Kata.Verification {
 
     @EntryPoint()
     operation CheckSolution() : Bool {
-        let isCorrect = AssertEqualOnZeroState(Kata.PrepareSuperposition, PrepareSuperposition_Reference);
-        if isCorrect {
-            Message("Correct!");
-        } else {
-            Message("Incorrect.");
-        }
-        return isCorrect;
+        CheckEqualOnZeroState(Kata.PrepareSuperposition, PrepareSuperposition_Reference)
     }
 }
diff --git a/katas/content/multi_qubit_systems/prepare_with_complex/index.md b/katas/content/multi_qubit_systems/prepare_with_complex/index.md
index ff5a0641..25d268d7 100644
--- a/katas/content/multi_qubit_systems/prepare_with_complex/index.md
+++ b/katas/content/multi_qubit_systems/prepare_with_complex/index.md
@@ -1,9 +1,11 @@
 
 **Input:** A two-qubit system in the basis state $|00\rangle = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}$.
 
-**Goal:** Transform the system into the state $\frac{1}{2}\big(|00\rangle + e^{i\pi/4}|01\rangle + e^{i\pi/2}|10\rangle + e^{3i\pi/4}|11\rangle\big) = \frac{1}{2}\begin{bmatrix} 1 \\ e^{i\pi/4} \\ e^{i\pi/2} \\ e^{3i\pi/4} \end{bmatrix}$.
+**Goal:** Transform the system into the state $\frac{1}{2}\big(|00\rangle + e^{i\pi/2}|01\rangle + e^{i\pi/4}|10\rangle + e^{3i\pi/4}|11\rangle\big) = \frac{1}{2}\begin{bmatrix} 1 \\ e^{i\pi/2} \\ e^{i\pi/4} \\ e^{3i\pi/4} \end{bmatrix}$.
+
+> Note that the quantum states are represented in little-endian format For a state $|qs_1 qs_0\rangle$, the "first" qubit (`qs[0]` in a Q# qubit register) refers to the least-significant qubit $qs_0$, while the "second" qubit (`qs[1]` in a Q# register) refers to the most-significant qubit $qs_1$.
 
 <details>
     <summary><b>Need a hint?</b></summary>
-    Represent the target state as a tensor product $\frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/2}|1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/4}|1\rangle\big) = \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ e^{i\pi/2} \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ e^{i\pi/4} \end{bmatrix}$.
+    Represent the target state as a tensor product $\frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/4}|1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/2}|1\rangle\big) = \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ e^{i\pi/4} \end{bmatrix} \otimes \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ e^{i\pi/2} \end{bmatrix}$.
 </details>
diff --git a/katas/content/multi_qubit_systems/prepare_with_complex/solution.md b/katas/content/multi_qubit_systems/prepare_with_complex/solution.md
index 721deedb..61383822 100644
--- a/katas/content/multi_qubit_systems/prepare_with_complex/solution.md
+++ b/katas/content/multi_qubit_systems/prepare_with_complex/solution.md
@@ -4,9 +4,9 @@ $$ \begin{bmatrix} 1 \\\ 0 \\\ 0 \\\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\\ 0 \
 The goal state, factored as a tensor product, looks like this (remember that $e^{3i\pi/4} = e^{i\pi/4} e^{i\pi/2}$):
 
 $$
-\frac{1}{2}\begin{bmatrix} 1 \\\ e^{i\pi/4} \\\ e^{i\pi/2} \\\ e^{3i\pi/4} \end{bmatrix} =
-\frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ e^{i\pi/2} \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ e^{i\pi/4} \end{bmatrix} =
-\frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/2}|1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/4}|1\rangle\big) $$
+\frac{1}{2}\begin{bmatrix} 1 \\\ e^{i\pi/2} \\\ e^{i\pi/4} \\\ e^{3i\pi/4} \end{bmatrix} =
+\frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ e^{i\pi/4} \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ e^{i\pi/2} \end{bmatrix} =
+\frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/4}|1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/2}|1\rangle\big) $$
 
 We will again need to adjust the states of both qubits independently.
 
@@ -14,7 +14,7 @@ For the first qubit, we'll start by applying the **H** gate, getting the state $
 
 $$ \begin{bmatrix} 1 & 0 \\\ 0 & i \end{bmatrix} \cdot \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ 1 \end{bmatrix} = \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ i \end{bmatrix}$$
 
-If we recall that $i = e^{i\pi/2}$, we can write the final state of the second qubit as:
+If we recall that $i = e^{i\pi/2}$, we can write the final state of the first qubit as:
 $$ \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ e^{i\pi/2} \end{bmatrix} $$
 
 For the second qubit. we'll apply the **H** gate, followed by the **T** gate, with the following result:
diff --git a/katas/content/multi_qubit_systems/prepare_with_complex/verification.qs b/katas/content/multi_qubit_systems/prepare_with_complex/verification.qs
index cd97362e..bff9b068 100644
--- a/katas/content/multi_qubit_systems/prepare_with_complex/verification.qs
+++ b/katas/content/multi_qubit_systems/prepare_with_complex/verification.qs
@@ -1,4 +1,6 @@
 namespace Kata.Verification {
+    open Microsoft.Quantum.Katas;
+
     operation PrepareWithComplex_Reference(qs : Qubit[]) : Unit is Adj + Ctl {
         H(qs[0]);
         H(qs[1]);
@@ -8,12 +10,6 @@ namespace Kata.Verification {
 
     @EntryPoint()
     operation CheckSolution() : Bool {
-        let isCorrect = AssertEqualOnZeroState(Kata.PrepareWithComplex, PrepareWithComplex_Reference);
-        if isCorrect {
-            Message("Correct!");
-        } else {
-            Message("Incorrect.");
-        }
-        return isCorrect;
+        CheckEqualOnZeroState(Kata.PrepareWithComplex, PrepareWithComplex_Reference)
     }
 }
diff --git a/katas/content/multi_qubit_systems/prepare_with_real/index.md b/katas/content/multi_qubit_systems/prepare_with_real/index.md
index 46f834f5..d14bee4f 100644
--- a/katas/content/multi_qubit_systems/prepare_with_real/index.md
+++ b/katas/content/multi_qubit_systems/prepare_with_real/index.md
@@ -1,9 +1,11 @@
 
 **Input:** A two-qubit system in the basis state $|00\rangle = \begin{bmatrix} 1 \\\ 0 \\\ 0 \\\ 0 \end{bmatrix}$.
 
-**Goal:** Transform the system into the state $\frac{1}{2}\big(|00\rangle - |01\rangle + |10\rangle - |11\rangle\big) = \frac{1}{2}\begin{bmatrix} 1 \\\ -1 \\\ 1 \\\ -1 \end{bmatrix}$.
+**Goal:** Transform the system into the state $\frac{1}{2}\big(|00\rangle + |01\rangle - |10\rangle - |11\rangle\big) = \frac{1}{2}\begin{bmatrix} 1 \\\ 1 \\\ -1 \\\ -1 \end{bmatrix}$.
+
+> Note that the quantum states are represented in little-endian format For a state $|qs_1 qs_0\rangle$, the "first" qubit (`qs[0]` in a Q# qubit register) refers to the least-significant qubit $qs_0$, while the "second" qubit (`qs[1]` in a Q# register) refers to the most-significant qubit $qs_1$.
 
 <details>
     <summary><b>Need a hint?</b></summary>
-    Represent the target state as a tensor product $\frac{1}{\sqrt2}\big(|0\rangle + |1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big) = \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ 1 \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ -1 \end{bmatrix}$.
+    Represent the target state as a tensor product $\frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle + |1\rangle\big) = \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ -1 \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ 1 \end{bmatrix}$.
 </details>
diff --git a/katas/content/multi_qubit_systems/prepare_with_real/solution.md b/katas/content/multi_qubit_systems/prepare_with_real/solution.md
index 195c251c..9bf5b750 100644
--- a/katas/content/multi_qubit_systems/prepare_with_real/solution.md
+++ b/katas/content/multi_qubit_systems/prepare_with_real/solution.md
@@ -1,6 +1,6 @@
 ﻿Again, to start we will represent the goal state as a tensor product of single-qubit states; this gives us the following representation:
 
-$$ \frac{1}{2}\big(|00\rangle - |01\rangle + |10\rangle - |11\rangle\big) = \frac{1}{2}\begin{bmatrix} 1 \\\ -1 \\\ 1 \\\ -1 \end{bmatrix} = \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ 1 \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ -1 \end{bmatrix} = \frac{1}{\sqrt2}\big(|0\rangle + |1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big)  $$
+$$ \frac{1}{2}\big(|00\rangle + |01\rangle - |10\rangle - |11\rangle\big) = \frac{1}{2}\begin{bmatrix} 1 \\\ 1 \\\ -1 \\\ -1 \end{bmatrix} = \frac{1}{\sqrt2} \begin{bmatrix} 1 \\\ -1 \end{bmatrix} \otimes \frac{1}{\sqrt2}\begin{bmatrix} 1 \\\ 1 \end{bmatrix} = \frac{1}{\sqrt2}\big(|0\rangle - |1\rangle\big) \otimes \frac{1}{\sqrt2}\big(|0\rangle + |1\rangle\big)$$
 
 This time we need to transform both the first and the second qubits. Let's start with the first qubit. Applying the **H** gate transforms its state as follows:
 
diff --git a/katas/content/multi_qubit_systems/prepare_with_real/verification.qs b/katas/content/multi_qubit_systems/prepare_with_real/verification.qs
index dc001905..75586038 100644
--- a/katas/content/multi_qubit_systems/prepare_with_real/verification.qs
+++ b/katas/content/multi_qubit_systems/prepare_with_real/verification.qs
@@ -1,4 +1,6 @@
 namespace Kata.Verification {
+    open Microsoft.Quantum.Katas;
+
     operation PrepareWithReal_Reference(qs : Qubit[]) : Unit is Adj + Ctl {
         H(qs[0]);
         X(qs[1]);
@@ -7,12 +9,6 @@ namespace Kata.Verification {
 
     @EntryPoint()
     operation CheckSolution() : Bool {
-        let isCorrect = AssertEqualOnZeroState(Kata.PrepareWithReal, PrepareWithReal_Reference);
-        if isCorrect {
-            Message("Correct!");
-        } else {
-            Message("Incorrect.");
-        }
-        return isCorrect;
+        CheckEqualOnZeroState(Kata.PrepareWithReal, PrepareWithReal_Reference)
     }
 }
diff --git a/pip/Cargo.toml b/pip/Cargo.toml
index d98a993e..c0f0e128 100644
--- a/pip/Cargo.toml
+++ b/pip/Cargo.toml
@@ -13,6 +13,7 @@ license.workspace = true
 num-bigint = { workspace = true }
 num-complex = { workspace = true }
 qsc = { path = "../compiler/qsc" }
+resource_estimator = { path = "../resource_estimator" }
 miette = { workspace = true, features = ["fancy"] }
 rustc-hash = { workspace = true }
 
diff --git a/pip/src/interpreter.rs b/pip/src/interpreter.rs
index f03e8244..1f3c8fde 100644
--- a/pip/src/interpreter.rs
+++ b/pip/src/interpreter.rs
@@ -20,16 +20,13 @@ use qsc::{
     fir,
     interpret::{
         output::{Error, Receiver},
-        stateful::{
-            self,
-            re::{self, estimate_expr},
-        },
-        Value,
+        stateful, Value,
     },
     project::{FileSystem, Manifest, ManifestDescriptor},
     target::Profile,
     PackageType, SourceMap,
 };
+use resource_estimator::{self as re, estimate_expr};
 use rustc_hash::FxHashMap;
 use std::fmt::Write;
 
diff --git a/resource_estimator/Cargo.toml b/resource_estimator/Cargo.toml
new file mode 100644
index 00000000..d658de54
--- /dev/null
+++ b/resource_estimator/Cargo.toml
@@ -0,0 +1,27 @@
+[package]
+name = "resource_estimator"
+
+version.workspace = true
+authors.workspace = true
+homepage.workspace = true
+repository.workspace = true
+edition.workspace = true
+license.workspace = true
+
+[dependencies]
+qsc = { path = "../compiler/qsc" }
+thiserror = { workspace = true }
+miette = { workspace = true, features = ["fancy"] }
+num-bigint = { workspace = true }
+num-complex = { workspace = true }
+rand = { workspace = true }
+rustc-hash = { workspace = true }
+probability = { workspace = true }
+regex-lite = { workspace = true }
+serde = { workspace = true, features = ["derive", "rc"] }
+serde_json = { workspace = true }
+fasteval = { workspace = true }
+
+[dev-dependencies]
+expect-test = { workspace = true }
+indoc = { workspace = true }
diff --git a/resource_estimator/README.md b/resource_estimator/README.md
new file mode 100644
index 00000000..b3f3b20f
--- /dev/null
+++ b/resource_estimator/README.md
@@ -0,0 +1,8 @@
+# Azure Quantum Resource Estimator
+
+The implementation for the Resource Estimator is broken up into two major components:
+
+- [counts](./src/counts.rs) - performs program execution tracing to capture the logical qubit and gate counts for the given program
+- [estimates](./src/estimates.rs) - takes in logical counts and a configuration to produce the set of corresponding physical resource estimates
+
+For more information about the Azure Quantum Resource Estimator, see [the official documentation](https://learn.microsoft.com/en-us/azure/quantum/intro-to-resource-estimation).
diff --git a/compiler/qsc/src/interpret/stateful/re/counts.rs b/resource_estimator/src/counts.rs
similarity index 99%
rename from compiler/qsc/src/interpret/stateful/re/counts.rs
rename to resource_estimator/src/counts.rs
index 045f5415..c956b1a3 100644
--- a/compiler/qsc/src/interpret/stateful/re/counts.rs
+++ b/resource_estimator/src/counts.rs
@@ -5,9 +5,9 @@
 mod tests;
 
 use super::LogicalResources;
-use crate::{interpret::Value, Backend};
 use num_bigint::BigUint;
 use num_complex::Complex;
+use qsc::{interpret::Value, Backend};
 use rand::{rngs::StdRng, Rng, SeedableRng};
 use rustc_hash::FxHashMap;
 use std::{
@@ -22,7 +22,6 @@ use std::{
 ///
 /// This counter tracks all resources while executing a QIR program.  It takes
 /// care of qubit management, gate counting, and depth calculation.
-#[allow(clippy::module_name_repetitions)]
 pub struct LogicalCounter {
     /// Stack of free qubits
     free_list: Vec<usize>,
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates.rs b/resource_estimator/src/estimates.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates.rs
rename to resource_estimator/src/estimates.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/compiled_expression.rs b/resource_estimator/src/estimates/compiled_expression.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/compiled_expression.rs
rename to resource_estimator/src/estimates/compiled_expression.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/constants.rs b/resource_estimator/src/estimates/constants.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/constants.rs
rename to resource_estimator/src/estimates/constants.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data.rs b/resource_estimator/src/estimates/data.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data.rs
rename to resource_estimator/src/estimates/data.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/constraints.rs b/resource_estimator/src/estimates/data/constraints.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/constraints.rs
rename to resource_estimator/src/estimates/data/constraints.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/job_params.rs b/resource_estimator/src/estimates/data/job_params.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/job_params.rs
rename to resource_estimator/src/estimates/data/job_params.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/logical_counts.rs b/resource_estimator/src/estimates/data/logical_counts.rs
similarity index 95%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/logical_counts.rs
rename to resource_estimator/src/estimates/data/logical_counts.rs
index 31cf78b1..ae8f8296 100644
--- a/compiler/qsc/src/interpret/stateful/re/estimates/data/logical_counts.rs
+++ b/resource_estimator/src/estimates/data/logical_counts.rs
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation.
 // Licensed under the MIT License.
 
-use crate::interpret::stateful::re::LogicalResources;
+use crate::LogicalResources;
 use serde::{Deserialize, Serialize};
 use std::convert::From;
 
diff --git a/compiler/qsc/src/interpret/stateful/re.rs b/resource_estimator/src/lib.rs
similarity index 98%
rename from compiler/qsc/src/interpret/stateful/re.rs
rename to resource_estimator/src/lib.rs
index d990570e..d82b8cf0 100644
--- a/compiler/qsc/src/interpret/stateful/re.rs
+++ b/resource_estimator/src/lib.rs
@@ -6,13 +6,13 @@ mod estimates;
 
 pub use estimates::estimate_physical_resources_from_json;
 
-use crate::interpret::{
-    stateful::{self, Interpreter},
-    GenericReceiver,
-};
 use counts::LogicalCounter;
 use estimates::estimate_physical_resources;
 use miette::Diagnostic;
+use qsc::interpret::{
+    stateful::{self, Interpreter},
+    GenericReceiver,
+};
 use thiserror::Error;
 
 #[derive(Debug)]
diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml
index d3e8cdb4..168ce184 100644
--- a/wasm/Cargo.toml
+++ b/wasm/Cargo.toml
@@ -26,6 +26,7 @@ qsls = { path = "../language_service" }
 qsc = { path = "../compiler/qsc" }
 qsc_codegen = { path = "../compiler/qsc_codegen" }
 qsc_project = { path = "../compiler/qsc_project", features = ["async"] }
+resource_estimator = { path = "../resource_estimator" }
 serde = { workspace = true, features = ["derive"]}
 serde-wasm-bindgen = { workspace = true}
 wasm-bindgen = { workspace = true}
diff --git a/wasm/src/lib.rs b/wasm/src/lib.rs
index df203a4c..f2643acd 100644
--- a/wasm/src/lib.rs
+++ b/wasm/src/lib.rs
@@ -9,19 +9,17 @@ use num_bigint::BigUint;
 use num_complex::Complex64;
 use project_system::*;
 use qsc::{
-    compile::{self},
+    compile,
     hir::PackageId,
     interpret::{
         output::{self, Receiver},
-        stateful::{
-            self,
-            re::{self, estimate_entry},
-        },
+        stateful,
     },
     target::Profile,
     PackageStore, PackageType, SourceContents, SourceMap, SourceName, SparseSim,
 };
 use qsc_codegen::qir_base::generate_qir;
+use resource_estimator::{self as re, estimate_entry};
 use serde_json::json;
 use std::{fmt::Write, sync::Arc};
 use wasm_bindgen::prelude::*;


Test patch:
diff --git a/compiler/qsc/src/interpret/stateful/re/counts/tests.rs b/resource_estimator/src/counts/tests.rs
similarity index 99%
rename from compiler/qsc/src/interpret/stateful/re/counts/tests.rs
rename to resource_estimator/src/counts/tests.rs
index c11e2b3c..491c9bc8 100644
--- a/compiler/qsc/src/interpret/stateful/re/counts/tests.rs
+++ b/resource_estimator/src/counts/tests.rs
@@ -5,13 +5,13 @@
 
 use std::convert::Into;
 
-use crate::{
+use expect_test::{expect, Expect};
+use indoc::indoc;
+use qsc::{
     interpret::{stateful::Interpreter, GenericReceiver},
     target::Profile,
     PackageType, SourceMap,
 };
-use expect_test::{expect, Expect};
-use indoc::indoc;
 
 use super::LogicalCounter;
 
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/physical_counts.rs b/resource_estimator/src/estimates/data/physical_counts.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/physical_counts.rs
rename to resource_estimator/src/estimates/data/physical_counts.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/profile/tests.rs b/resource_estimator/src/estimates/data/profile/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/profile/tests.rs
rename to resource_estimator/src/estimates/data/profile/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/report.rs b/resource_estimator/src/estimates/data/report.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/report.rs
rename to resource_estimator/src/estimates/data/report.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/report/tests.rs b/resource_estimator/src/estimates/data/report/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/report/tests.rs
rename to resource_estimator/src/estimates/data/report/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/result.rs b/resource_estimator/src/estimates/data/result.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/result.rs
rename to resource_estimator/src/estimates/data/result.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/data/tfactory.rs b/resource_estimator/src/estimates/data/tfactory.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/data/tfactory.rs
rename to resource_estimator/src/estimates/data/tfactory.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/error.rs b/resource_estimator/src/estimates/error.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/error.rs
rename to resource_estimator/src/estimates/error.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling.rs b/resource_estimator/src/estimates/modeling.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling.rs
rename to resource_estimator/src/estimates/modeling.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling/error_budget.rs b/resource_estimator/src/estimates/modeling/error_budget.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling/error_budget.rs
rename to resource_estimator/src/estimates/modeling/error_budget.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling/fault_tolerance.rs b/resource_estimator/src/estimates/modeling/fault_tolerance.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling/fault_tolerance.rs
rename to resource_estimator/src/estimates/modeling/fault_tolerance.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling/fault_tolerance/tests.rs b/resource_estimator/src/estimates/modeling/fault_tolerance/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling/fault_tolerance/tests.rs
rename to resource_estimator/src/estimates/modeling/fault_tolerance/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling/logical_qubit.rs b/resource_estimator/src/estimates/modeling/logical_qubit.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling/logical_qubit.rs
rename to resource_estimator/src/estimates/modeling/logical_qubit.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling/logical_qubit/tests.rs b/resource_estimator/src/estimates/modeling/logical_qubit/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling/logical_qubit/tests.rs
rename to resource_estimator/src/estimates/modeling/logical_qubit/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling/physical_qubit.rs b/resource_estimator/src/estimates/modeling/physical_qubit.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling/physical_qubit.rs
rename to resource_estimator/src/estimates/modeling/physical_qubit.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/modeling/physical_qubit/tests.rs b/resource_estimator/src/estimates/modeling/physical_qubit/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/modeling/physical_qubit/tests.rs
rename to resource_estimator/src/estimates/modeling/physical_qubit/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization.rs b/resource_estimator/src/estimates/optimization.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization.rs
rename to resource_estimator/src/estimates/optimization.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/code_distance_iterators.rs b/resource_estimator/src/estimates/optimization/code_distance_iterators.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/code_distance_iterators.rs
rename to resource_estimator/src/estimates/optimization/code_distance_iterators.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/code_distance_iterators/tests.rs b/resource_estimator/src/estimates/optimization/code_distance_iterators/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/code_distance_iterators/tests.rs
rename to resource_estimator/src/estimates/optimization/code_distance_iterators/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/distillation_units_map.rs b/resource_estimator/src/estimates/optimization/distillation_units_map.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/distillation_units_map.rs
rename to resource_estimator/src/estimates/optimization/distillation_units_map.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/distillation_units_map/tests.rs b/resource_estimator/src/estimates/optimization/distillation_units_map/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/distillation_units_map/tests.rs
rename to resource_estimator/src/estimates/optimization/distillation_units_map/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/population.rs b/resource_estimator/src/estimates/optimization/population.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/population.rs
rename to resource_estimator/src/estimates/optimization/population.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/population/tests.rs b/resource_estimator/src/estimates/optimization/population/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/population/tests.rs
rename to resource_estimator/src/estimates/optimization/population/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/tfactory_exhaustive.rs b/resource_estimator/src/estimates/optimization/tfactory_exhaustive.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/tfactory_exhaustive.rs
rename to resource_estimator/src/estimates/optimization/tfactory_exhaustive.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/optimization/tfactory_exhaustive/tests.rs b/resource_estimator/src/estimates/optimization/tfactory_exhaustive/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/optimization/tfactory_exhaustive/tests.rs
rename to resource_estimator/src/estimates/optimization/tfactory_exhaustive/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/serialization.rs b/resource_estimator/src/estimates/serialization.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/serialization.rs
rename to resource_estimator/src/estimates/serialization.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/serialization/tests.rs b/resource_estimator/src/estimates/serialization/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/serialization/tests.rs
rename to resource_estimator/src/estimates/serialization/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/stages.rs b/resource_estimator/src/estimates/stages.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/stages.rs
rename to resource_estimator/src/estimates/stages.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/stages/layout.rs b/resource_estimator/src/estimates/stages/layout.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/stages/layout.rs
rename to resource_estimator/src/estimates/stages/layout.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/stages/physical_estimation.rs b/resource_estimator/src/estimates/stages/physical_estimation.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/stages/physical_estimation.rs
rename to resource_estimator/src/estimates/stages/physical_estimation.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/stages/physical_estimation/counts.json b/resource_estimator/src/estimates/stages/physical_estimation/counts.json
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/stages/physical_estimation/counts.json
rename to resource_estimator/src/estimates/stages/physical_estimation/counts.json
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/stages/physical_estimation/tests.rs b/resource_estimator/src/estimates/stages/physical_estimation/tests.rs
similarity index 99%
rename from compiler/qsc/src/interpret/stateful/re/estimates/stages/physical_estimation/tests.rs
rename to resource_estimator/src/estimates/stages/physical_estimation/tests.rs
index 2ce054ce..b62d8a57 100644
--- a/compiler/qsc/src/interpret/stateful/re/estimates/stages/physical_estimation/tests.rs
+++ b/resource_estimator/src/estimates/stages/physical_estimation/tests.rs
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation.
 // Licensed under the MIT License.
 
-use crate::interpret::stateful::re::estimates::modeling::GateBasedPhysicalQubit;
+use crate::estimates::modeling::GateBasedPhysicalQubit;
 
 use super::{
     super::super::{
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/stages/tfactory.rs b/resource_estimator/src/estimates/stages/tfactory.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/stages/tfactory.rs
rename to resource_estimator/src/estimates/stages/tfactory.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/stages/tfactory/tests.rs b/resource_estimator/src/estimates/stages/tfactory/tests.rs
similarity index 100%
rename from compiler/qsc/src/interpret/stateful/re/estimates/stages/tfactory/tests.rs
rename to resource_estimator/src/estimates/stages/tfactory/tests.rs
diff --git a/compiler/qsc/src/interpret/stateful/re/estimates/tests.rs b/resource_estimator/src/estimates/tests.rs
similarity index 97%
rename from compiler/qsc/src/interpret/stateful/re/estimates/tests.rs
rename to resource_estimator/src/estimates/tests.rs
index a4fa0e8e..3a873c62 100644
--- a/compiler/qsc/src/interpret/stateful/re/estimates/tests.rs
+++ b/resource_estimator/src/estimates/tests.rs
@@ -3,7 +3,7 @@
 
 use serde_json::Value;
 
-use crate::interpret::stateful::re::LogicalResources;
+use crate::LogicalResources;
 
 use super::estimate_physical_resources;