From 059ad853a2ab74723300a85927bd1272544830cd Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 11:52:35 -0500 Subject: [PATCH 01/11] Fix bug in result creation and add instantiation of EFGSS to how-to --- ...ntanglement_forging_ground_state_solver.py | 11 ++---- .../how-tos/freeze-orbitals.ipynb | 34 ++++++++++++------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/circuit_knitting/forging/entanglement_forging_ground_state_solver.py b/circuit_knitting/forging/entanglement_forging_ground_state_solver.py index b40c01e3b..f1df19c21 100644 --- a/circuit_knitting/forging/entanglement_forging_ground_state_solver.py +++ b/circuit_knitting/forging/entanglement_forging_ground_state_solver.py @@ -25,7 +25,6 @@ import scipy import numpy as np -from qiskit.algorithms.minimum_eigensolvers import MinimumEigensolverResult from qiskit.algorithms.optimizers import SPSA, Optimizer, OptimizerResult from qiskit_nature.second_q.problems import ( ElectronicStructureProblem, @@ -317,13 +316,9 @@ def solve( # Create the EntanglementForgingResult from the results from the # results of eigenvalue minimization and other meta information - min_eigsolver_result = MinimumEigensolverResult() - min_eigsolver_result.eigenvalue = optimal_evaluation.eigenvalue - min_eigsolver_result.eigenstate = optimal_evaluation.eigenstate - result = EntanglementForgingResult.from_minimum_eigensolver_result( - min_eigsolver_result - ) - result.energy_shift = self._energy_shift + result = EntanglementForgingResult() + result.eigenvalues = np.asarray([optimal_evaluation.eigenvalue]) + result.eigenstates = [optimal_evaluation.eigenstate] result.history = self._history.evaluations result.elapsed_time = elapsed_time diff --git a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb index 5a7545c8e..7dee30d1c 100644 --- a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb +++ b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb @@ -9,15 +9,6 @@ "In this guide, we apply Entanglement Forging to compute the energy of a $\\mathrm{H}_2\\mathrm{O}$ molecule. We reduce the number of orbitals in the problem, in turn reducing the number of qubits needed in each circuit, following the logic given in the [explanatory material](../explanation/index.rst)." ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Import the relevant modules\n", - "\n", - "First, we import the relevant modules. The imports are similar to the introductory tutorial, but this time, we also import the `reduce_bitstrings` function from `circuit_knitting.utils`." - ] - }, { "cell_type": "code", "execution_count": 1, @@ -33,11 +24,14 @@ "import numpy as np\n", "\n", "from qiskit.circuit import QuantumCircuit, Parameter\n", + "from qiskit.algorithms.optimizers import COBYLA\n", "from qiskit_nature.second_q.drivers import PySCFDriver\n", "from qiskit_nature.second_q.problems import ElectronicBasis\n", + "from qiskit_nature.second_q.formats import get_ao_to_mo_from_qcschema\n", "\n", "from circuit_knitting.forging import (\n", " EntanglementForgingAnsatz,\n", + " EntanglementForgingGroundStateSolver,\n", ")\n", "from circuit_knitting.utils import reduce_bitstrings" ] @@ -70,11 +64,12 @@ "H2_x = radius_2 * np.cos(np.pi / 180 * thetas_in_deg)\n", "H2_y = radius_2 * np.sin(np.pi / 180 * thetas_in_deg)\n", "\n", + "# Create an ElectronicStructureProblem from the molecule using PySCFDriver\n", "driver = PySCFDriver(\n", " f\"O 0.0 0.0 0.0; H {H1_x} 0.0 0.0; H {H2_x} {H2_y} 0.0\", basis=\"sto6g\"\n", ")\n", "driver.run()\n", - "problem = driver.to_problem(basis=ElectronicBasis.AO)" + "problem = driver.to_problem()" ] }, { @@ -197,6 +192,21 @@ "ansatz.circuit_u.draw()" ] }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "optimizer = COBYLA(maxiter=100)\n", + "\n", + "solver = EntanglementForgingGroundStateSolver(\n", + " ansatz=ansatz,\n", + " optimizer=optimizer,\n", + " orbitals_to_reduce=orbitals_to_reduce,\n", + ")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -206,13 +216,13 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "

Version Information

Qiskit SoftwareVersion
qiskit-terra0.23.3
qiskit-aer0.12.0
qiskit-ibmq-provider0.20.2
qiskit-nature0.5.2
System information
Python version3.8.16
Python compilerClang 14.0.6
Python builddefault, Mar 1 2023 21:19:10
OSDarwin
CPUs8
Memory (Gb)32.0
Tue Apr 11 19:14:09 2023 CDT
" + "

Version Information

Qiskit SoftwareVersion
qiskit-terra0.24.0
qiskit-aer0.12.0
qiskit-ibmq-provider0.20.2
qiskit-nature0.6.0
System information
Python version3.8.16
Python compilerClang 14.0.6
Python builddefault, Mar 1 2023 21:19:10
OSDarwin
CPUs8
Memory (Gb)32.0
Sat Jun 17 11:51:45 2023 CDT
" ], "text/plain": [ "" From f131e7cb13ea904f496f07a2383d3d1fdf4ff0df Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 11:57:22 -0500 Subject: [PATCH 02/11] Add comments to how-to --- .../how-tos/freeze-orbitals.ipynb | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb index 7dee30d1c..b7eef4628 100644 --- a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb +++ b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb @@ -79,13 +79,6 @@ "### Prepare the bitstrings and the ansatz" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The ansatz for Entanglement Forging consists of a set of input bitstrings and a parameterized circuit. (See the [explanatory material](../explanation/index.rst) section of the documentation for additional background on the method.) For this demo, we will use the same bitstrings and ansatz for both the U and V subsystems. " - ] - }, { "cell_type": "code", "execution_count": 3, @@ -128,6 +121,13 @@ "hop_gate.draw()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create the ansatz with a reduced set of bitstrings." + ] + }, { "cell_type": "code", "execution_count": 4, @@ -192,6 +192,13 @@ "ansatz.circuit_u.draw()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create the ``EntanglementForgingGroundStateSolver``, and specify which orbitals to reduce in the observable." + ] + }, { "cell_type": "code", "execution_count": 5, From 9c275077e9ca691290523230650009b21ca1ce1b Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 12:13:42 -0500 Subject: [PATCH 03/11] Re-add missing results field --- .../forging/entanglement_forging_ground_state_solver.py | 1 + test/forging/test_entanglement_forging_ground_state_solver.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/circuit_knitting/forging/entanglement_forging_ground_state_solver.py b/circuit_knitting/forging/entanglement_forging_ground_state_solver.py index f1df19c21..07ea6cfcb 100644 --- a/circuit_knitting/forging/entanglement_forging_ground_state_solver.py +++ b/circuit_knitting/forging/entanglement_forging_ground_state_solver.py @@ -320,6 +320,7 @@ def solve( result.eigenvalues = np.asarray([optimal_evaluation.eigenvalue]) result.eigenstates = [optimal_evaluation.eigenstate] result.history = self._history.evaluations + result.energy_shift = self._energy_shift result.elapsed_time = elapsed_time # Close any runtime sessions diff --git a/test/forging/test_entanglement_forging_ground_state_solver.py b/test/forging/test_entanglement_forging_ground_state_solver.py index 648a66c1f..3b9d759cc 100644 --- a/test/forging/test_entanglement_forging_ground_state_solver.py +++ b/test/forging/test_entanglement_forging_ground_state_solver.py @@ -70,6 +70,7 @@ def test_entanglement_forging_vqe_hydrogen(self): # Solve for the ground state energy results = solver.solve(problem) ground_state_energy = results.groundenergy + results.energy_shift - + print(results.groundenergy) + print(results.energy_shift) # Ensure ground state energy output is within tolerance self.assertAlmostEqual(ground_state_energy, -1.121936544469326) From 85cfdf87f62fd243c7e5b7127e8127644dec784e Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 12:21:42 -0500 Subject: [PATCH 04/11] Add release note --- circuit_knitting/forging/__init__.py | 3 +++ releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml diff --git a/circuit_knitting/forging/__init__.py b/circuit_knitting/forging/__init__.py index 2167b7465..bd0afc2ed 100644 --- a/circuit_knitting/forging/__init__.py +++ b/circuit_knitting/forging/__init__.py @@ -25,6 +25,7 @@ EntanglementForgingOperator EntanglementForgingAnsatz EntanglementForgingGroundStateSolver + EntanglementForgingResult Decomposition Functions ======================= @@ -43,6 +44,7 @@ from .entanglement_forging_operator import EntanglementForgingOperator from .entanglement_forging_ground_state_solver import ( EntanglementForgingGroundStateSolver, + EntanglementForgingResult, ) from .cholesky_decomposition import cholesky_decomposition, convert_cholesky_operator @@ -51,6 +53,7 @@ "EntanglementForgingKnitter", "EntanglementForgingOperator", "EntanglementForgingGroundStateSolver", + "EntanglementForgingResult", "cholesky_decomposition", "convert_cholesky_operator", ] diff --git a/releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml b/releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml new file mode 100644 index 000000000..101bfe597 --- /dev/null +++ b/releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed a bug in :class:`~circuit_knitting.forging.EntanglementForgingGroundStateSolver` which was causing + AttributeErrors when instantiating the `~circuit_knitting.forging.EntanglementForgingResult` in certain + conditions, such as when reducing the orbitals over which to solve. From 197ae2e4f9f055a454acf6626fc2bc7651635e60 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 12:24:57 -0500 Subject: [PATCH 05/11] Remove unnecessary imports --- docs/entanglement_forging/how-tos/freeze-orbitals.ipynb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb index b7eef4628..ebc7a53a1 100644 --- a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb +++ b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2021-04-27T13:41:07.878080Z", @@ -26,8 +26,6 @@ "from qiskit.circuit import QuantumCircuit, Parameter\n", "from qiskit.algorithms.optimizers import COBYLA\n", "from qiskit_nature.second_q.drivers import PySCFDriver\n", - "from qiskit_nature.second_q.problems import ElectronicBasis\n", - "from qiskit_nature.second_q.formats import get_ao_to_mo_from_qcschema\n", "\n", "from circuit_knitting.forging import (\n", " EntanglementForgingAnsatz,\n", From 63980b131dbbf0669279f4e0f91d8a878e2de822 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 12:32:09 -0500 Subject: [PATCH 06/11] Fix eigenstates field in result --- .../forging/entanglement_forging_ground_state_solver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit_knitting/forging/entanglement_forging_ground_state_solver.py b/circuit_knitting/forging/entanglement_forging_ground_state_solver.py index 07ea6cfcb..c9d8dd602 100644 --- a/circuit_knitting/forging/entanglement_forging_ground_state_solver.py +++ b/circuit_knitting/forging/entanglement_forging_ground_state_solver.py @@ -318,7 +318,7 @@ def solve( # results of eigenvalue minimization and other meta information result = EntanglementForgingResult() result.eigenvalues = np.asarray([optimal_evaluation.eigenvalue]) - result.eigenstates = [optimal_evaluation.eigenstate] + result.eigenstates = [(optimal_evaluation.eigenstate, None)] result.history = self._history.evaluations result.energy_shift = self._energy_shift result.elapsed_time = elapsed_time From e8ee8fd776f4af226202739398ccabb145c48a44 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 12:37:03 -0500 Subject: [PATCH 07/11] Remove optimizer from how to --- docs/entanglement_forging/how-tos/freeze-orbitals.ipynb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb index ebc7a53a1..0470d8eeb 100644 --- a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb +++ b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb @@ -24,7 +24,6 @@ "import numpy as np\n", "\n", "from qiskit.circuit import QuantumCircuit, Parameter\n", - "from qiskit.algorithms.optimizers import COBYLA\n", "from qiskit_nature.second_q.drivers import PySCFDriver\n", "\n", "from circuit_knitting.forging import (\n", @@ -203,11 +202,8 @@ "metadata": {}, "outputs": [], "source": [ - "optimizer = COBYLA(maxiter=100)\n", - "\n", "solver = EntanglementForgingGroundStateSolver(\n", " ansatz=ansatz,\n", - " optimizer=optimizer,\n", " orbitals_to_reduce=orbitals_to_reduce,\n", ")" ] From 5b2af3d3c6c0b92777aac70d9f318a6f8d4ab224 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sat, 17 Jun 2023 12:56:03 -0500 Subject: [PATCH 08/11] Remove prints --- test/forging/test_entanglement_forging_ground_state_solver.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/forging/test_entanglement_forging_ground_state_solver.py b/test/forging/test_entanglement_forging_ground_state_solver.py index 3b9d759cc..1ef97c131 100644 --- a/test/forging/test_entanglement_forging_ground_state_solver.py +++ b/test/forging/test_entanglement_forging_ground_state_solver.py @@ -70,7 +70,5 @@ def test_entanglement_forging_vqe_hydrogen(self): # Solve for the ground state energy results = solver.solve(problem) ground_state_energy = results.groundenergy + results.energy_shift - print(results.groundenergy) - print(results.energy_shift) # Ensure ground state energy output is within tolerance self.assertAlmostEqual(ground_state_energy, -1.121936544469326) From 196b72810086fd35ea07d55fff6b4590639f7712 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sun, 18 Jun 2023 20:52:06 -0500 Subject: [PATCH 09/11] Revert accidental change --- test/forging/test_entanglement_forging_ground_state_solver.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/forging/test_entanglement_forging_ground_state_solver.py b/test/forging/test_entanglement_forging_ground_state_solver.py index 1ef97c131..648a66c1f 100644 --- a/test/forging/test_entanglement_forging_ground_state_solver.py +++ b/test/forging/test_entanglement_forging_ground_state_solver.py @@ -70,5 +70,6 @@ def test_entanglement_forging_vqe_hydrogen(self): # Solve for the ground state energy results = solver.solve(problem) ground_state_energy = results.groundenergy + results.energy_shift + # Ensure ground state energy output is within tolerance self.assertAlmostEqual(ground_state_energy, -1.121936544469326) From 6c411e24b7fe7b6ed33c17932b565d812e1a5065 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Sun, 18 Jun 2023 20:56:18 -0500 Subject: [PATCH 10/11] Clean up how-to --- .../how-tos/freeze-orbitals.ipynb | 78 +++++-------------- 1 file changed, 19 insertions(+), 59 deletions(-) diff --git a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb index 0470d8eeb..05233531f 100644 --- a/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb +++ b/docs/entanglement_forging/how-tos/freeze-orbitals.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2021-04-27T13:41:07.878080Z", @@ -37,9 +37,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Instantiate the `ElectronicStructureProblem`\n", - "\n", - "Next, we set up the $\\mathrm{H}_2\\mathrm{O}$ molecule, specify the driver and converter, and instantiate an `ElectronicStructureProblem`." + "First, we set up the $\\mathrm{H}_2\\mathrm{O}$ molecule, specify the driver and converter, and instantiate an `ElectronicStructureProblem`." ] }, { @@ -69,55 +67,6 @@ "problem = driver.to_problem()" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Prepare the bitstrings and the ansatz" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
     ┌───┐┌───┐     ┌────────────┐     ┌───┐\n",
-       "q_0: ┤ H ├┤ X ├──■──┤ Ry(-1.0*θ) ├──■──┤ H ├\n",
-       "     └───┘└─┬─┘┌─┴─┐├────────────┤┌─┴─┐└───┘\n",
-       "q_1: ───────■──┤ X ├┤ Ry(-1.0*θ) ├┤ X ├─────\n",
-       "               └───┘└────────────┘└───┘     
" - ], - "text/plain": [ - " ┌───┐┌───┐ ┌────────────┐ ┌───┐\n", - "q_0: ┤ H ├┤ X ├──■──┤ Ry(-1.0*θ) ├──■──┤ H ├\n", - " └───┘└─┬─┘┌─┴─┐├────────────┤┌─┴─┐└───┘\n", - "q_1: ───────■──┤ X ├┤ Ry(-1.0*θ) ├┤ X ├─────\n", - " └───┘└────────────┘└───┘ " - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "theta = Parameter(\"θ\")\n", - "\n", - "hop_gate = QuantumCircuit(2, name=\"Hop gate\")\n", - "hop_gate.h(0)\n", - "hop_gate.cx(1, 0)\n", - "hop_gate.cx(0, 1)\n", - "hop_gate.ry(-theta, 0)\n", - "hop_gate.ry(-theta, 1)\n", - "hop_gate.cx(0, 1)\n", - "hop_gate.h(0)\n", - "\n", - "hop_gate.draw()" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -127,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -159,12 +108,23 @@ " └───────────────┘└──────────────┘└───────────────┘" ] }, - "execution_count": 4, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "theta = Parameter(\"θ\")\n", + "\n", + "hop_gate = QuantumCircuit(2, name=\"Hop gate\")\n", + "hop_gate.h(0)\n", + "hop_gate.cx(1, 0)\n", + "hop_gate.cx(0, 1)\n", + "hop_gate.ry(-theta, 0)\n", + "hop_gate.ry(-theta, 1)\n", + "hop_gate.cx(0, 1)\n", + "hop_gate.h(0)\n", + "\n", "theta_1, theta_2, theta_3, theta_4 = (\n", " Parameter(\"θ1\"),\n", " Parameter(\"θ2\"),\n", @@ -193,12 +153,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Create the ``EntanglementForgingGroundStateSolver``, and specify which orbitals to reduce in the observable." + "Create the ``EntanglementForgingGroundStateSolver``, and specify which orbitals to reduce in the problem." ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -217,13 +177,13 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "

Version Information

Qiskit SoftwareVersion
qiskit-terra0.24.0
qiskit-aer0.12.0
qiskit-ibmq-provider0.20.2
qiskit-nature0.6.0
System information
Python version3.8.16
Python compilerClang 14.0.6
Python builddefault, Mar 1 2023 21:19:10
OSDarwin
CPUs8
Memory (Gb)32.0
Sat Jun 17 11:51:45 2023 CDT
" + "

Version Information

Qiskit SoftwareVersion
qiskit-terra0.24.0
qiskit-aer0.12.0
qiskit-ibmq-provider0.20.2
qiskit-nature0.6.0
System information
Python version3.8.16
Python compilerClang 14.0.6
Python builddefault, Mar 1 2023 21:19:10
OSDarwin
CPUs8
Memory (Gb)32.0
Sun Jun 18 20:55:50 2023 CDT
" ], "text/plain": [ "" From d4ac6935d1b5e20357145c5335e4ba58b96413d2 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Tue, 20 Jun 2023 14:39:03 -0500 Subject: [PATCH 11/11] Update releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml Co-authored-by: Jim Garrison --- releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml b/releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml index 101bfe597..30f9b0297 100644 --- a/releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml +++ b/releasenotes/notes/ef-results-bug-5aa84ca5611dd827.yaml @@ -2,5 +2,5 @@ fixes: - | Fixed a bug in :class:`~circuit_knitting.forging.EntanglementForgingGroundStateSolver` which was causing - AttributeErrors when instantiating the `~circuit_knitting.forging.EntanglementForgingResult` in certain + ``AttributeError``\ s when instantiating the `~circuit_knitting.forging.EntanglementForgingResult` in certain conditions, such as when reducing the orbitals over which to solve.