diff --git a/.doctrees/api/ffsim.doctree b/.doctrees/api/ffsim.doctree index 3fec6a4f6..bb8ecc3ea 100644 Binary files a/.doctrees/api/ffsim.doctree and b/.doctrees/api/ffsim.doctree differ diff --git a/.doctrees/api/ffsim.qiskit.doctree b/.doctrees/api/ffsim.qiskit.doctree index 9c2792c0d..467be7482 100644 Binary files a/.doctrees/api/ffsim.qiskit.doctree and b/.doctrees/api/ffsim.qiskit.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index 2e935f6bf..6c717f41c 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/explanations/hamiltonians.doctree b/.doctrees/explanations/hamiltonians.doctree index d046117d3..bc3f209ec 100644 Binary files a/.doctrees/explanations/hamiltonians.doctree and b/.doctrees/explanations/hamiltonians.doctree differ diff --git a/.doctrees/how-to-guides/entanglement-forging.doctree b/.doctrees/how-to-guides/entanglement-forging.doctree index e15963886..a96584686 100644 Binary files a/.doctrees/how-to-guides/entanglement-forging.doctree and b/.doctrees/how-to-guides/entanglement-forging.doctree differ diff --git a/.doctrees/how-to-guides/fermion-operator.doctree b/.doctrees/how-to-guides/fermion-operator.doctree index addfb0f85..2e6ad29d0 100644 Binary files a/.doctrees/how-to-guides/fermion-operator.doctree and b/.doctrees/how-to-guides/fermion-operator.doctree differ diff --git a/.doctrees/how-to-guides/lucj.doctree b/.doctrees/how-to-guides/lucj.doctree index 42f83dddc..86ba3d2af 100644 Binary files a/.doctrees/how-to-guides/lucj.doctree and b/.doctrees/how-to-guides/lucj.doctree differ diff --git a/.doctrees/nbsphinx/explanations/hamiltonians.ipynb b/.doctrees/nbsphinx/explanations/hamiltonians.ipynb index e1c1f2a94..dc782d0d9 100644 --- a/.doctrees/nbsphinx/explanations/hamiltonians.ipynb +++ b/.doctrees/nbsphinx/explanations/hamiltonians.ipynb @@ -33,10 +33,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:45.177839Z", - "iopub.status.busy": "2024-04-29T11:29:45.177394Z", - "iopub.status.idle": "2024-04-29T11:29:45.793060Z", - "shell.execute_reply": "2024-04-29T11:29:45.792468Z" + "iopub.execute_input": "2024-04-29T12:27:27.786789Z", + "iopub.status.busy": "2024-04-29T12:27:27.786334Z", + "iopub.status.idle": "2024-04-29T12:27:28.387057Z", + "shell.execute_reply": "2024-04-29T12:27:28.386518Z" } }, "outputs": [], @@ -68,10 +68,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:45.796015Z", - "iopub.status.busy": "2024-04-29T11:29:45.795538Z", - "iopub.status.idle": "2024-04-29T11:29:45.798490Z", - "shell.execute_reply": "2024-04-29T11:29:45.798019Z" + "iopub.execute_input": "2024-04-29T12:27:28.390029Z", + "iopub.status.busy": "2024-04-29T12:27:28.389557Z", + "iopub.status.idle": "2024-04-29T12:27:28.392532Z", + "shell.execute_reply": "2024-04-29T12:27:28.392055Z" } }, "outputs": [], @@ -99,10 +99,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:45.800957Z", - "iopub.status.busy": "2024-04-29T11:29:45.800585Z", - "iopub.status.idle": "2024-04-29T11:29:45.803695Z", - "shell.execute_reply": "2024-04-29T11:29:45.803188Z" + "iopub.execute_input": "2024-04-29T12:27:28.394787Z", + "iopub.status.busy": "2024-04-29T12:27:28.394419Z", + "iopub.status.idle": "2024-04-29T12:27:28.397626Z", + "shell.execute_reply": "2024-04-29T12:27:28.397145Z" } }, "outputs": [], @@ -127,10 +127,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:45.806123Z", - "iopub.status.busy": "2024-04-29T11:29:45.805767Z", - "iopub.status.idle": "2024-04-29T11:29:45.810606Z", - "shell.execute_reply": "2024-04-29T11:29:45.810001Z" + "iopub.execute_input": "2024-04-29T12:27:28.399761Z", + "iopub.status.busy": "2024-04-29T12:27:28.399542Z", + "iopub.status.idle": "2024-04-29T12:27:28.404543Z", + "shell.execute_reply": "2024-04-29T12:27:28.403973Z" } }, "outputs": [], @@ -152,17 +152,17 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:45.814166Z", - "iopub.status.busy": "2024-04-29T11:29:45.813199Z", - "iopub.status.idle": "2024-04-29T11:29:45.846198Z", - "shell.execute_reply": "2024-04-29T11:29:45.845528Z" + "iopub.execute_input": "2024-04-29T12:27:28.407444Z", + "iopub.status.busy": "2024-04-29T12:27:28.406907Z", + "iopub.status.idle": "2024-04-29T12:27:28.437493Z", + "shell.execute_reply": "2024-04-29T12:27:28.436820Z" } }, "outputs": [ { "data": { "text/plain": [ - "-99.55717072551575" + "-99.55717072551572" ] }, "execution_count": 5, @@ -191,10 +191,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:45.878148Z", - "iopub.status.busy": "2024-04-29T11:29:45.877722Z", - "iopub.status.idle": "2024-04-29T11:29:46.678755Z", - "shell.execute_reply": "2024-04-29T11:29:46.678108Z" + "iopub.execute_input": "2024-04-29T12:27:28.471137Z", + "iopub.status.busy": "2024-04-29T12:27:28.470595Z", + "iopub.status.idle": "2024-04-29T12:27:29.239267Z", + "shell.execute_reply": "2024-04-29T12:27:29.238622Z" } }, "outputs": [ @@ -202,7 +202,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_4374/2190712273.py:2: UserWarning: Trace of LinearOperator not available, it will be estimated. Provide `traceA` to ensure performance.\n", + "/tmp/ipykernel_4397/2190712273.py:2: UserWarning: Trace of LinearOperator not available, it will be estimated. Provide `traceA` to ensure performance.\n", " evolved_vec = scipy.sparse.linalg.expm_multiply(-1j * time * linop, vec)\n" ] } @@ -224,10 +224,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:46.682776Z", - "iopub.status.busy": "2024-04-29T11:29:46.681604Z", - "iopub.status.idle": "2024-04-29T11:29:47.558188Z", - "shell.execute_reply": "2024-04-29T11:29:47.557565Z" + "iopub.execute_input": "2024-04-29T12:27:29.243622Z", + "iopub.status.busy": "2024-04-29T12:27:29.242559Z", + "iopub.status.idle": "2024-04-29T12:27:30.127447Z", + "shell.execute_reply": "2024-04-29T12:27:30.126811Z" } }, "outputs": [], diff --git a/.doctrees/nbsphinx/explanations/orbital-rotation.ipynb b/.doctrees/nbsphinx/explanations/orbital-rotation.ipynb index 51b57323b..dbb16fa37 100644 --- a/.doctrees/nbsphinx/explanations/orbital-rotation.ipynb +++ b/.doctrees/nbsphinx/explanations/orbital-rotation.ipynb @@ -62,10 +62,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:49.231375Z", - "iopub.status.busy": "2024-04-29T11:29:49.231182Z", - "iopub.status.idle": "2024-04-29T11:29:49.834398Z", - "shell.execute_reply": "2024-04-29T11:29:49.833870Z" + "iopub.execute_input": "2024-04-29T12:27:31.760549Z", + "iopub.status.busy": "2024-04-29T12:27:31.760341Z", + "iopub.status.idle": "2024-04-29T12:27:32.383573Z", + "shell.execute_reply": "2024-04-29T12:27:32.383042Z" } }, "outputs": [], diff --git a/.doctrees/nbsphinx/explanations/state-vectors-and-gates.ipynb b/.doctrees/nbsphinx/explanations/state-vectors-and-gates.ipynb index 6b56a514d..91da4dc33 100644 --- a/.doctrees/nbsphinx/explanations/state-vectors-and-gates.ipynb +++ b/.doctrees/nbsphinx/explanations/state-vectors-and-gates.ipynb @@ -26,10 +26,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:51.314778Z", - "iopub.status.busy": "2024-04-29T11:29:51.314542Z", - "iopub.status.idle": "2024-04-29T11:29:51.926253Z", - "shell.execute_reply": "2024-04-29T11:29:51.925680Z" + "iopub.execute_input": "2024-04-29T12:27:33.730288Z", + "iopub.status.busy": "2024-04-29T12:27:33.729742Z", + "iopub.status.idle": "2024-04-29T12:27:34.351837Z", + "shell.execute_reply": "2024-04-29T12:27:34.351189Z" } }, "outputs": [ @@ -74,10 +74,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:51.928889Z", - "iopub.status.busy": "2024-04-29T11:29:51.928412Z", - "iopub.status.idle": "2024-04-29T11:29:51.935495Z", - "shell.execute_reply": "2024-04-29T11:29:51.934993Z" + "iopub.execute_input": "2024-04-29T12:27:34.354453Z", + "iopub.status.busy": "2024-04-29T12:27:34.354020Z", + "iopub.status.idle": "2024-04-29T12:27:34.360926Z", + "shell.execute_reply": "2024-04-29T12:27:34.360417Z" } }, "outputs": [ @@ -118,10 +118,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:51.937801Z", - "iopub.status.busy": "2024-04-29T11:29:51.937500Z", - "iopub.status.idle": "2024-04-29T11:29:51.941902Z", - "shell.execute_reply": "2024-04-29T11:29:51.941304Z" + "iopub.execute_input": "2024-04-29T12:27:34.363159Z", + "iopub.status.busy": "2024-04-29T12:27:34.362965Z", + "iopub.status.idle": "2024-04-29T12:27:34.367424Z", + "shell.execute_reply": "2024-04-29T12:27:34.366930Z" } }, "outputs": [ @@ -155,10 +155,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:51.944285Z", - "iopub.status.busy": "2024-04-29T11:29:51.943826Z", - "iopub.status.idle": "2024-04-29T11:29:51.948078Z", - "shell.execute_reply": "2024-04-29T11:29:51.947594Z" + "iopub.execute_input": "2024-04-29T12:27:34.369733Z", + "iopub.status.busy": "2024-04-29T12:27:34.369382Z", + "iopub.status.idle": "2024-04-29T12:27:34.373426Z", + "shell.execute_reply": "2024-04-29T12:27:34.372952Z" } }, "outputs": [ @@ -197,10 +197,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:51.950503Z", - "iopub.status.busy": "2024-04-29T11:29:51.950055Z", - "iopub.status.idle": "2024-04-29T11:29:51.956400Z", - "shell.execute_reply": "2024-04-29T11:29:51.955904Z" + "iopub.execute_input": "2024-04-29T12:27:34.375604Z", + "iopub.status.busy": "2024-04-29T12:27:34.375411Z", + "iopub.status.idle": "2024-04-29T12:27:34.381388Z", + "shell.execute_reply": "2024-04-29T12:27:34.380934Z" } }, "outputs": [ @@ -243,10 +243,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:51.958836Z", - "iopub.status.busy": "2024-04-29T11:29:51.958458Z", - "iopub.status.idle": "2024-04-29T11:29:51.963349Z", - "shell.execute_reply": "2024-04-29T11:29:51.962789Z" + "iopub.execute_input": "2024-04-29T12:27:34.383486Z", + "iopub.status.busy": "2024-04-29T12:27:34.383295Z", + "iopub.status.idle": "2024-04-29T12:27:34.388557Z", + "shell.execute_reply": "2024-04-29T12:27:34.388077Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/how-to-guides/entanglement-forging.ipynb b/.doctrees/nbsphinx/how-to-guides/entanglement-forging.ipynb index ef4535e2d..8016626d6 100644 --- a/.doctrees/nbsphinx/how-to-guides/entanglement-forging.ipynb +++ b/.doctrees/nbsphinx/how-to-guides/entanglement-forging.ipynb @@ -18,10 +18,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:53.414745Z", - "iopub.status.busy": "2024-04-29T11:29:53.414519Z", - "iopub.status.idle": "2024-04-29T11:29:54.229797Z", - "shell.execute_reply": "2024-04-29T11:29:54.229199Z" + "iopub.execute_input": "2024-04-29T12:27:36.163552Z", + "iopub.status.busy": "2024-04-29T12:27:36.163358Z", + "iopub.status.idle": "2024-04-29T12:27:36.973173Z", + "shell.execute_reply": "2024-04-29T12:27:36.972581Z" } }, "outputs": [ @@ -105,10 +105,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:54.233743Z", - "iopub.status.busy": "2024-04-29T11:29:54.233185Z", - "iopub.status.idle": "2024-04-29T11:29:54.237927Z", - "shell.execute_reply": "2024-04-29T11:29:54.237468Z" + "iopub.execute_input": "2024-04-29T12:27:36.976683Z", + "iopub.status.busy": "2024-04-29T12:27:36.976389Z", + "iopub.status.idle": "2024-04-29T12:27:36.981041Z", + "shell.execute_reply": "2024-04-29T12:27:36.980457Z" } }, "outputs": [], @@ -148,10 +148,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:54.240301Z", - "iopub.status.busy": "2024-04-29T11:29:54.239972Z", - "iopub.status.idle": "2024-04-29T11:29:54.243159Z", - "shell.execute_reply": "2024-04-29T11:29:54.242694Z" + "iopub.execute_input": "2024-04-29T12:27:36.983369Z", + "iopub.status.busy": "2024-04-29T12:27:36.983014Z", + "iopub.status.idle": "2024-04-29T12:27:36.986198Z", + "shell.execute_reply": "2024-04-29T12:27:36.985639Z" } }, "outputs": [], @@ -180,10 +180,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:54.245588Z", - "iopub.status.busy": "2024-04-29T11:29:54.245160Z", - "iopub.status.idle": "2024-04-29T11:29:54.320427Z", - "shell.execute_reply": "2024-04-29T11:29:54.319953Z" + "iopub.execute_input": "2024-04-29T12:27:36.988363Z", + "iopub.status.busy": "2024-04-29T12:27:36.988176Z", + "iopub.status.idle": "2024-04-29T12:27:37.064244Z", + "shell.execute_reply": "2024-04-29T12:27:37.063661Z" } }, "outputs": [ @@ -191,7 +191,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Energy at initialialization: -75.67794403659725\n" + "Energy at initialialization: -75.67794403659722\n" ] } ], @@ -218,10 +218,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:29:54.322625Z", - "iopub.status.busy": "2024-04-29T11:29:54.322411Z", - "iopub.status.idle": "2024-04-29T11:30:02.098914Z", - "shell.execute_reply": "2024-04-29T11:30:02.098354Z" + "iopub.execute_input": "2024-04-29T12:27:37.066784Z", + "iopub.status.busy": "2024-04-29T12:27:37.066408Z", + "iopub.status.idle": "2024-04-29T12:27:44.893255Z", + "shell.execute_reply": "2024-04-29T12:27:44.892615Z" } }, "outputs": [ @@ -233,10 +233,10 @@ " message: STOP: TOTAL NO. of f AND g EVALUATIONS EXCEEDS LIMIT\n", " success: False\n", " status: 1\n", - " fun: -75.68381558382175\n", - " x: [-1.603e-01 6.415e-03 ... 5.748e-02 -1.005e-01]\n", + " fun: -75.68381571232878\n", + " x: [-1.603e-01 6.412e-03 ... 5.747e-02 -1.005e-01]\n", " nit: 3\n", - " jac: [ 2.160e-04 1.194e-04 ... -4.744e-03 7.449e-03]\n", + " jac: [ 2.203e-04 1.094e-04 ... -4.736e-03 7.384e-03]\n", " nfev: 112\n", " njev: 7\n", " hess_inv: <15x15 LbfgsInvHessProduct with dtype=float64>\n" diff --git a/.doctrees/nbsphinx/how-to-guides/fermion-operator.ipynb b/.doctrees/nbsphinx/how-to-guides/fermion-operator.ipynb index 0c90a05a0..758f5022e 100644 --- a/.doctrees/nbsphinx/how-to-guides/fermion-operator.ipynb +++ b/.doctrees/nbsphinx/how-to-guides/fermion-operator.ipynb @@ -29,10 +29,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:03.511954Z", - "iopub.status.busy": "2024-04-29T11:30:03.511765Z", - "iopub.status.idle": "2024-04-29T11:30:04.111905Z", - "shell.execute_reply": "2024-04-29T11:30:04.111273Z" + "iopub.execute_input": "2024-04-29T12:27:46.352761Z", + "iopub.status.busy": "2024-04-29T12:27:46.352301Z", + "iopub.status.idle": "2024-04-29T12:27:46.968850Z", + "shell.execute_reply": "2024-04-29T12:27:46.968215Z" } }, "outputs": [ @@ -40,9 +40,9 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_b(1), des_b(5), cre_a(4)): 1+1j,\n", + " (cre_a(0), des_a(3)): 0.5,\n", " (cre_a(3), des_a(0)): -0.25,\n", - " (cre_a(0), des_a(3)): 0.5\n", + " (cre_b(1), des_b(5), cre_a(4)): 1+1j\n", "})" ] }, @@ -76,17 +76,17 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.114641Z", - "iopub.status.busy": "2024-04-29T11:30:04.114075Z", - "iopub.status.idle": "2024-04-29T11:30:04.118093Z", - "shell.execute_reply": "2024-04-29T11:30:04.117574Z" + "iopub.execute_input": "2024-04-29T12:27:46.971631Z", + "iopub.status.busy": "2024-04-29T12:27:46.971206Z", + "iopub.status.idle": "2024-04-29T12:27:46.975376Z", + "shell.execute_reply": "2024-04-29T12:27:46.974900Z" } }, "outputs": [ { "data": { "text/plain": [ - "'FermionOperator({((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 3), (False, False, 0)): -0.25+0j, ((True, False, 0), (False, False, 3)): 0.5+0j})'" + "'FermionOperator({((True, False, 0), (False, False, 3)): 0.5+0j, ((True, False, 3), (False, False, 0)): -0.25+0j, ((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j})'" ] }, "execution_count": 2, @@ -110,10 +110,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.120245Z", - "iopub.status.busy": "2024-04-29T11:30:04.120052Z", - "iopub.status.idle": "2024-04-29T11:30:04.124627Z", - "shell.execute_reply": "2024-04-29T11:30:04.124139Z" + "iopub.execute_input": "2024-04-29T12:27:46.977656Z", + "iopub.status.busy": "2024-04-29T12:27:46.977325Z", + "iopub.status.idle": "2024-04-29T12:27:46.981687Z", + "shell.execute_reply": "2024-04-29T12:27:46.981129Z" } }, "outputs": [ @@ -121,17 +121,17 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -0.25-0.25j,\n", + " (cre_a(3), des_a(0), des_a(3), des_b(3)): 0.0625,\n", " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,\n", - " (cre_a(3), des_a(0)): -0.5,\n", - " (des_a(3), des_b(3)): 0.0625,\n", " (cre_b(2)): 0-0.25j,\n", - " (cre_a(0), des_a(3)): 1,\n", " (cre_a(3), des_a(0), cre_b(2)): 0-0.25j,\n", + " (cre_a(3), des_a(0)): -0.5,\n", " (cre_b(1), des_b(5), cre_a(4)): 2+2j,\n", - " (cre_a(3), des_a(0), des_a(3), des_b(3)): 0.0625,\n", + " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -0.25-0.25j,\n", " (cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,\n", - " (cre_a(0), des_a(3), cre_b(2)): 0+0.5j\n", + " (cre_a(0), des_a(3), cre_b(2)): 0+0.5j,\n", + " (cre_a(0), des_a(3)): 1,\n", + " (des_a(3), des_b(3)): 0.0625\n", "})" ] }, @@ -170,10 +170,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.126846Z", - "iopub.status.busy": "2024-04-29T11:30:04.126488Z", - "iopub.status.idle": "2024-04-29T11:30:04.130427Z", - "shell.execute_reply": "2024-04-29T11:30:04.129879Z" + "iopub.execute_input": "2024-04-29T12:27:46.983944Z", + "iopub.status.busy": "2024-04-29T12:27:46.983586Z", + "iopub.status.idle": "2024-04-29T12:27:46.987498Z", + "shell.execute_reply": "2024-04-29T12:27:46.986934Z" } }, "outputs": [ @@ -181,17 +181,17 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,\n", + " (cre_a(3), des_a(0), des_a(3), des_b(3)): 0-0.25j,\n", " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,\n", - " (cre_a(3), des_a(0)): 0+3j,\n", - " (des_a(3), des_b(3)): 0-1.25j,\n", " (cre_b(2)): -5,\n", - " (cre_a(0), des_a(3)): 0-6j,\n", " (cre_a(3), des_a(0), cre_b(2)): -1,\n", + " (cre_a(3), des_a(0)): 0+3j,\n", " (cre_b(1), des_b(5), cre_a(4)): 12-12j,\n", - " (cre_a(3), des_a(0), des_a(3), des_b(3)): 0-0.25j,\n", + " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,\n", " (cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,\n", - " (cre_a(0), des_a(3), cre_b(2)): 2\n", + " (cre_a(0), des_a(3), cre_b(2)): 2,\n", + " (cre_a(0), des_a(3)): 0-6j,\n", + " (des_a(3), des_b(3)): 0-1.25j\n", "})" ] }, @@ -220,10 +220,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.132626Z", - "iopub.status.busy": "2024-04-29T11:30:04.132303Z", - "iopub.status.idle": "2024-04-29T11:30:04.135956Z", - "shell.execute_reply": "2024-04-29T11:30:04.135491Z" + "iopub.execute_input": "2024-04-29T12:27:46.989840Z", + "iopub.status.busy": "2024-04-29T12:27:46.989474Z", + "iopub.status.idle": "2024-04-29T12:27:46.993257Z", + "shell.execute_reply": "2024-04-29T12:27:46.992710Z" } }, "outputs": [ @@ -231,16 +231,16 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_a(3), des_b(3), des_a(3), des_a(0)): 0+0.25j,\n", - " (cre_a(0), des_a(3)): 0-6j,\n", + " (cre_b(2), cre_b(1), cre_a(4), des_b(5)): 4+4j,\n", " (cre_b(2), cre_a(3), des_a(0)): -1,\n", - " (cre_b(2)): -5,\n", - " (cre_b(2), cre_a(0), des_a(3)): 2,\n", - " (cre_a(3), des_a(0)): 0+3j,\n", " (des_b(3), des_a(3)): 0+1.25j,\n", - " (cre_b(1), cre_a(4), des_b(5), des_b(3), des_a(3)): -1+1j,\n", + " (cre_a(3), des_b(3), des_a(3), des_a(0)): 0+0.25j,\n", + " (cre_a(3), des_a(0)): 0+3j,\n", " (cre_b(1), cre_a(4), des_b(5)): -12+12j,\n", - " (cre_b(2), cre_b(1), cre_a(4), des_b(5)): 4+4j\n", + " (cre_b(1), cre_a(4), des_b(5), des_b(3), des_a(3)): -1+1j,\n", + " (cre_b(2)): -5,\n", + " (cre_b(2), cre_a(0), des_a(3)): 2,\n", + " (cre_a(0), des_a(3)): 0-6j\n", "})" ] }, @@ -265,10 +265,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.138185Z", - "iopub.status.busy": "2024-04-29T11:30:04.137848Z", - "iopub.status.idle": "2024-04-29T11:30:04.141130Z", - "shell.execute_reply": "2024-04-29T11:30:04.140537Z" + "iopub.execute_input": "2024-04-29T12:27:46.995431Z", + "iopub.status.busy": "2024-04-29T12:27:46.995095Z", + "iopub.status.idle": "2024-04-29T12:27:46.998405Z", + "shell.execute_reply": "2024-04-29T12:27:46.997846Z" } }, "outputs": [ @@ -298,10 +298,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.143545Z", - "iopub.status.busy": "2024-04-29T11:30:04.143192Z", - "iopub.status.idle": "2024-04-29T11:30:04.147287Z", - "shell.execute_reply": "2024-04-29T11:30:04.146701Z" + "iopub.execute_input": "2024-04-29T12:27:47.000732Z", + "iopub.status.busy": "2024-04-29T12:27:47.000379Z", + "iopub.status.idle": "2024-04-29T12:27:47.004565Z", + "shell.execute_reply": "2024-04-29T12:27:47.003997Z" } }, "outputs": [ @@ -341,21 +341,21 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.149765Z", - "iopub.status.busy": "2024-04-29T11:30:04.149242Z", - "iopub.status.idle": "2024-04-29T11:30:04.154798Z", - "shell.execute_reply": "2024-04-29T11:30:04.154153Z" + "iopub.execute_input": "2024-04-29T12:27:47.006791Z", + "iopub.status.busy": "2024-04-29T12:27:47.006454Z", + "iopub.status.idle": "2024-04-29T12:27:47.012415Z", + "shell.execute_reply": "2024-04-29T12:27:47.011809Z" } }, "outputs": [ { "data": { "text/plain": [ - "array([0. +0.j , 0. +0.j ,\n", - " 0. +0.j , 0. +0.j ,\n", - " 0.02404118-0.0351354j, 0. +0.j ,\n", - " 0. +0.j , 0. +0.j ,\n", - " 0. +0.j ])" + "array([ 0. +0.j , 0. +0.j ,\n", + " 0. +0.j , 0. +0.j ,\n", + " -0.08897206-0.09438409j, 0. +0.j ,\n", + " 0. +0.j , 0. +0.j ,\n", + " 0. +0.j ])" ] }, "execution_count": 8, @@ -380,10 +380,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:04.157321Z", - "iopub.status.busy": "2024-04-29T11:30:04.156866Z", - "iopub.status.idle": "2024-04-29T11:30:04.168520Z", - "shell.execute_reply": "2024-04-29T11:30:04.167968Z" + "iopub.execute_input": "2024-04-29T12:27:47.014990Z", + "iopub.status.busy": "2024-04-29T12:27:47.014505Z", + "iopub.status.idle": "2024-04-29T12:27:47.026087Z", + "shell.execute_reply": "2024-04-29T12:27:47.025518Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/how-to-guides/lucj.ipynb b/.doctrees/nbsphinx/how-to-guides/lucj.ipynb index 7fcddfd55..7dfe280cf 100644 --- a/.doctrees/nbsphinx/how-to-guides/lucj.ipynb +++ b/.doctrees/nbsphinx/how-to-guides/lucj.ipynb @@ -14,10 +14,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:06.013846Z", - "iopub.status.busy": "2024-04-29T11:30:06.013655Z", - "iopub.status.idle": "2024-04-29T11:30:06.955265Z", - "shell.execute_reply": "2024-04-29T11:30:06.954628Z" + "iopub.execute_input": "2024-04-29T12:27:48.961938Z", + "iopub.status.busy": "2024-04-29T12:27:48.961419Z", + "iopub.status.idle": "2024-04-29T12:27:49.896358Z", + "shell.execute_reply": "2024-04-29T12:27:49.895739Z" } }, "outputs": [ @@ -107,10 +107,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:06.958913Z", - "iopub.status.busy": "2024-04-29T11:30:06.958278Z", - "iopub.status.idle": "2024-04-29T11:30:07.161770Z", - "shell.execute_reply": "2024-04-29T11:30:07.161212Z" + "iopub.execute_input": "2024-04-29T12:27:49.900719Z", + "iopub.status.busy": "2024-04-29T12:27:49.899600Z", + "iopub.status.idle": "2024-04-29T12:27:50.130524Z", + "shell.execute_reply": "2024-04-29T12:27:50.129935Z" } }, "outputs": [ @@ -118,7 +118,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "E(CCSD) = -77.49387212754471 E_corr = -0.04824536314851305\n" + "E(CCSD) = -77.49387212754468 E_corr = -0.04824536314851351\n" ] }, { @@ -170,10 +170,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:07.164371Z", - "iopub.status.busy": "2024-04-29T11:30:07.164098Z", - "iopub.status.idle": "2024-04-29T11:30:51.904623Z", - "shell.execute_reply": "2024-04-29T11:30:51.904049Z" + "iopub.execute_input": "2024-04-29T12:27:50.134662Z", + "iopub.status.busy": "2024-04-29T12:27:50.133653Z", + "iopub.status.idle": "2024-04-29T12:28:34.989064Z", + "shell.execute_reply": "2024-04-29T12:28:34.988501Z" } }, "outputs": [ @@ -185,10 +185,10 @@ " message: STOP: TOTAL NO. of ITERATIONS REACHED LIMIT\n", " success: False\n", " status: 1\n", - " fun: -77.50957472948254\n", - " x: [ 5.225e-01 -3.879e-01 ... 8.963e-02 1.359e-01]\n", + " fun: -77.50963842904653\n", + " x: [ 1.263e+00 -4.688e-01 ... 8.690e-02 1.366e-01]\n", " nit: 5\n", - " jac: [ 8.427e-04 -8.143e-04 ... -3.294e-03 -5.073e-03]\n", + " jac: [-4.974e-05 6.395e-04 ... -3.604e-03 -4.502e-03]\n", " nfev: 584\n", " njev: 8\n", " hess_inv: <72x72 LbfgsInvHessProduct with dtype=float64>\n" @@ -243,10 +243,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:30:51.908369Z", - "iopub.status.busy": "2024-04-29T11:30:51.907858Z", - "iopub.status.idle": "2024-04-29T11:31:24.066045Z", - "shell.execute_reply": "2024-04-29T11:31:24.065472Z" + "iopub.execute_input": "2024-04-29T12:28:34.993216Z", + "iopub.status.busy": "2024-04-29T12:28:34.992236Z", + "iopub.status.idle": "2024-04-29T12:29:06.886828Z", + "shell.execute_reply": "2024-04-29T12:29:06.886184Z" } }, "outputs": [ @@ -258,10 +258,10 @@ " message: STOP: TOTAL NO. of ITERATIONS REACHED LIMIT\n", " success: False\n", " status: 1\n", - " fun: -77.45735186229277\n", - " x: [ 5.296e-01 -3.871e-01 ... -2.293e-03 1.062e-02]\n", + " fun: -77.45740952655616\n", + " x: [ 1.265e+00 -4.794e-01 ... 8.192e-03 8.208e-03]\n", " nit: 5\n", - " jac: [ 1.297e-03 8.171e-04 ... -3.372e-03 -1.857e-03]\n", + " jac: [ 1.307e-04 -1.407e-04 ... -1.249e-03 -3.453e-03]\n", " nfev: 423\n", " njev: 9\n", " hess_inv: <46x46 LbfgsInvHessProduct with dtype=float64>\n" @@ -311,10 +311,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:24.069082Z", - "iopub.status.busy": "2024-04-29T11:31:24.068856Z", - "iopub.status.idle": "2024-04-29T11:31:51.772873Z", - "shell.execute_reply": "2024-04-29T11:31:51.772184Z" + "iopub.execute_input": "2024-04-29T12:29:06.891311Z", + "iopub.status.busy": "2024-04-29T12:29:06.890161Z", + "iopub.status.idle": "2024-04-29T12:29:39.824335Z", + "shell.execute_reply": "2024-04-29T12:29:39.823709Z" } }, "outputs": [ @@ -325,34 +325,34 @@ "Number of parameters: 46\n", " message: Stop: Total number of iterations reached limit.\n", " success: False\n", - " fun: -77.48260923717831\n", - " x: [ 7.996e-01 -5.333e-01 ... 3.215e-01 -5.873e-01]\n", + " fun: -77.4578454353424\n", + " x: [-3.826e+00 8.925e+00 ... 9.729e-01 6.437e-01]\n", " nit: 5\n", - " jac: [-4.104e-03 -1.517e-02 ... 5.971e-03 2.608e-03]\n", - " nfev: 814\n", + " jac: [ 8.774e-04 2.046e-03 ... -1.669e-05 -3.269e-03]\n", + " nfev: 841\n", " njev: 5\n", - " nlinop: 584\n", + " nlinop: 611\n", "\n", "Iteration 1\n", - " Energy: -77.45673584901218\n", - " Norm of gradient: 0.0164958131367898\n", - " Regularization hyperparameter: 0.02367629095824064\n", - " Variation hyperparameter: 0.33755681746167365\n", + " Energy: -77.43103721276847\n", + " Norm of gradient: 0.08729592721294072\n", + " Regularization hyperparameter: 1.2732954031856018e-11\n", + " Variation hyperparameter: 0.504987065321155\n", "Iteration 2\n", - " Energy: -77.45770347328356\n", - " Norm of gradient: 0.01001824149909948\n", - " Regularization hyperparameter: 0.000414413936600847\n", - " Variation hyperparameter: 0.3443513407932839\n", + " Energy: -77.4314789553586\n", + " Norm of gradient: 0.08531313567180646\n", + " Regularization hyperparameter: 8.352929781916682\n", + " Variation hyperparameter: 0.9988348999036183\n", "Iteration 3\n", - " Energy: -77.45773149347707\n", - " Norm of gradient: 0.009652495691516466\n", - " Regularization hyperparameter: 1.0400899203240295\n", - " Variation hyperparameter: 0.33013657203896457\n", + " Energy: -77.44619365555918\n", + " Norm of gradient: 0.015845038941322578\n", + " Regularization hyperparameter: 0.028364385191491454\n", + " Variation hyperparameter: 0.9974661839606402\n", "Iteration 4\n", - " Energy: -77.46626526615785\n", - " Norm of gradient: 0.04805410196761204\n", - " Regularization hyperparameter: 0.0017303281460898086\n", - " Variation hyperparameter: 0.1748618163102763\n" + " Energy: -77.45391634843948\n", + " Norm of gradient: 0.023687069370341447\n", + " Regularization hyperparameter: 0.003615488377960778\n", + " Variation hyperparameter: 0.9974709394967256\n" ] } ], diff --git a/.doctrees/nbsphinx/tutorials/double-factorized-trotter.ipynb b/.doctrees/nbsphinx/tutorials/double-factorized-trotter.ipynb index b8fefab92..40883e76e 100644 --- a/.doctrees/nbsphinx/tutorials/double-factorized-trotter.ipynb +++ b/.doctrees/nbsphinx/tutorials/double-factorized-trotter.ipynb @@ -18,10 +18,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:53.401657Z", - "iopub.status.busy": "2024-04-29T11:31:53.401204Z", - "iopub.status.idle": "2024-04-29T11:31:54.058194Z", - "shell.execute_reply": "2024-04-29T11:31:54.057609Z" + "iopub.execute_input": "2024-04-29T12:29:41.431200Z", + "iopub.status.busy": "2024-04-29T12:29:41.430997Z", + "iopub.status.idle": "2024-04-29T12:29:42.092292Z", + "shell.execute_reply": "2024-04-29T12:29:42.091658Z" } }, "outputs": [ @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.061249Z", - "iopub.status.busy": "2024-04-29T11:31:54.060704Z", - "iopub.status.idle": "2024-04-29T11:31:54.065083Z", - "shell.execute_reply": "2024-04-29T11:31:54.064500Z" + "iopub.execute_input": "2024-04-29T12:29:42.095377Z", + "iopub.status.busy": "2024-04-29T12:29:42.094795Z", + "iopub.status.idle": "2024-04-29T12:29:42.099198Z", + "shell.execute_reply": "2024-04-29T12:29:42.098618Z" } }, "outputs": [], @@ -105,10 +105,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.067656Z", - "iopub.status.busy": "2024-04-29T11:31:54.067279Z", - "iopub.status.idle": "2024-04-29T11:31:54.072307Z", - "shell.execute_reply": "2024-04-29T11:31:54.071780Z" + "iopub.execute_input": "2024-04-29T12:29:42.101757Z", + "iopub.status.busy": "2024-04-29T12:29:42.101398Z", + "iopub.status.idle": "2024-04-29T12:29:42.106500Z", + "shell.execute_reply": "2024-04-29T12:29:42.105993Z" } }, "outputs": [ @@ -171,10 +171,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.074538Z", - "iopub.status.busy": "2024-04-29T11:31:54.074185Z", - "iopub.status.idle": "2024-04-29T11:31:54.078718Z", - "shell.execute_reply": "2024-04-29T11:31:54.078122Z" + "iopub.execute_input": "2024-04-29T12:29:42.108873Z", + "iopub.status.busy": "2024-04-29T12:29:42.108532Z", + "iopub.status.idle": "2024-04-29T12:29:42.113165Z", + "shell.execute_reply": "2024-04-29T12:29:42.112544Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.080938Z", - "iopub.status.busy": "2024-04-29T11:31:54.080747Z", - "iopub.status.idle": "2024-04-29T11:31:54.084742Z", - "shell.execute_reply": "2024-04-29T11:31:54.084247Z" + "iopub.execute_input": "2024-04-29T12:29:42.115291Z", + "iopub.status.busy": "2024-04-29T12:29:42.115096Z", + "iopub.status.idle": "2024-04-29T12:29:42.119008Z", + "shell.execute_reply": "2024-04-29T12:29:42.118412Z" } }, "outputs": [ @@ -241,10 +241,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.087008Z", - "iopub.status.busy": "2024-04-29T11:31:54.086650Z", - "iopub.status.idle": "2024-04-29T11:31:54.105086Z", - "shell.execute_reply": "2024-04-29T11:31:54.104616Z" + "iopub.execute_input": "2024-04-29T12:29:42.121247Z", + "iopub.status.busy": "2024-04-29T12:29:42.121060Z", + "iopub.status.idle": "2024-04-29T12:29:42.139791Z", + "shell.execute_reply": "2024-04-29T12:29:42.139177Z" } }, "outputs": [ @@ -252,7 +252,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Maximum error in a tensor entry: 0.036685417309834434\n" + "Maximum error in a tensor entry: 0.036685417309834656\n" ] } ], @@ -301,10 +301,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.107450Z", - "iopub.status.busy": "2024-04-29T11:31:54.106964Z", - "iopub.status.idle": "2024-04-29T11:31:54.111330Z", - "shell.execute_reply": "2024-04-29T11:31:54.110832Z" + "iopub.execute_input": "2024-04-29T12:29:42.142152Z", + "iopub.status.busy": "2024-04-29T12:29:42.141790Z", + "iopub.status.idle": "2024-04-29T12:29:42.146634Z", + "shell.execute_reply": "2024-04-29T12:29:42.146002Z" } }, "outputs": [], @@ -359,10 +359,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.113376Z", - "iopub.status.busy": "2024-04-29T11:31:54.113183Z", - "iopub.status.idle": "2024-04-29T11:31:54.116626Z", - "shell.execute_reply": "2024-04-29T11:31:54.116164Z" + "iopub.execute_input": "2024-04-29T12:29:42.149048Z", + "iopub.status.busy": "2024-04-29T12:29:42.148677Z", + "iopub.status.idle": "2024-04-29T12:29:42.152301Z", + "shell.execute_reply": "2024-04-29T12:29:42.151810Z" } }, "outputs": [], @@ -399,10 +399,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.118760Z", - "iopub.status.busy": "2024-04-29T11:31:54.118550Z", - "iopub.status.idle": "2024-04-29T11:31:57.082872Z", - "shell.execute_reply": "2024-04-29T11:31:57.082221Z" + "iopub.execute_input": "2024-04-29T12:29:42.154510Z", + "iopub.status.busy": "2024-04-29T12:29:42.154171Z", + "iopub.status.idle": "2024-04-29T12:29:45.128898Z", + "shell.execute_reply": "2024-04-29T12:29:45.128243Z" } }, "outputs": [], @@ -438,10 +438,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.086304Z", - "iopub.status.busy": "2024-04-29T11:31:57.085850Z", - "iopub.status.idle": "2024-04-29T11:31:57.170646Z", - "shell.execute_reply": "2024-04-29T11:31:57.169978Z" + "iopub.execute_input": "2024-04-29T12:29:45.132287Z", + "iopub.status.busy": "2024-04-29T12:29:45.131875Z", + "iopub.status.idle": "2024-04-29T12:29:45.221794Z", + "shell.execute_reply": "2024-04-29T12:29:45.221229Z" } }, "outputs": [ @@ -449,7 +449,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9402435386998327\n" + "Fidelity of Trotter-evolved state with exact state: 0.9402393562171305\n" ] } ], @@ -479,10 +479,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.173582Z", - "iopub.status.busy": "2024-04-29T11:31:57.173358Z", - "iopub.status.idle": "2024-04-29T11:31:57.473983Z", - "shell.execute_reply": "2024-04-29T11:31:57.473356Z" + "iopub.execute_input": "2024-04-29T12:29:45.224698Z", + "iopub.status.busy": "2024-04-29T12:29:45.224266Z", + "iopub.status.idle": "2024-04-29T12:29:45.549121Z", + "shell.execute_reply": "2024-04-29T12:29:45.548546Z" } }, "outputs": [ @@ -490,7 +490,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.998521286151722\n" + "Fidelity of Trotter-evolved state with exact state: 0.9985211214229683\n" ] } ], @@ -520,10 +520,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.501012Z", - "iopub.status.busy": "2024-04-29T11:31:57.499862Z", - "iopub.status.idle": "2024-04-29T11:31:57.779011Z", - "shell.execute_reply": "2024-04-29T11:31:57.778445Z" + "iopub.execute_input": "2024-04-29T12:29:45.552137Z", + "iopub.status.busy": "2024-04-29T12:29:45.551663Z", + "iopub.status.idle": "2024-04-29T12:29:45.834944Z", + "shell.execute_reply": "2024-04-29T12:29:45.834355Z" } }, "outputs": [ @@ -531,7 +531,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9985212861517185\n" + "Fidelity of Trotter-evolved state with exact state: 0.9985211214229975\n" ] } ], @@ -562,10 +562,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.783749Z", - "iopub.status.busy": "2024-04-29T11:31:57.782767Z", - "iopub.status.idle": "2024-04-29T11:31:57.999128Z", - "shell.execute_reply": "2024-04-29T11:31:57.998592Z" + "iopub.execute_input": "2024-04-29T12:29:45.839258Z", + "iopub.status.busy": "2024-04-29T12:29:45.838261Z", + "iopub.status.idle": "2024-04-29T12:29:46.066669Z", + "shell.execute_reply": "2024-04-29T12:29:46.066059Z" } }, "outputs": [ @@ -573,7 +573,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9996731164189284\n" + "Fidelity of Trotter-evolved state with exact state: 0.9996731166933271\n" ] } ], diff --git a/.doctrees/tutorials/double-factorized-trotter.doctree b/.doctrees/tutorials/double-factorized-trotter.doctree index 9d89cdf31..914085738 100644 Binary files a/.doctrees/tutorials/double-factorized-trotter.doctree and b/.doctrees/tutorials/double-factorized-trotter.doctree differ diff --git a/_modules/ffsim/qiskit/slater_determinant.html b/_modules/ffsim/qiskit/slater_determinant.html index f7a18b126..b861b05ae 100644 --- a/_modules/ffsim/qiskit/slater_determinant.html +++ b/_modules/ffsim/qiskit/slater_determinant.html @@ -306,10 +306,10 @@
from pyscf.fci.spin_op import contract_ss
from ffsim.gates.orbital_rotation import apply_orbital_rotation
+from ffsim.spin import Spin
@@ -303,18 +304,30 @@ Source code for ffsim.states.states
def slater_determinant(
norb: int,
occupied_orbitals: tuple[Sequence[int], Sequence[int]],
- orbital_rotation: np.ndarray | None = None,
+ orbital_rotation: np.ndarray | tuple[np.ndarray, np.ndarray] | None = None,
) -> np.ndarray:
- """Return a Slater determinant.
+ r"""Return a Slater determinant.
+
+ A Slater determinant is a state of the form
+
+ .. math::
+
+ \mathcal{U} \lvert x \rangle,
+
+ where :math:`\mathcal{U}` is an
+ :doc:`orbital rotation </explanations/orbital-rotation>` and
+ :math:`\lvert x \rangle` is an electronic configuration.
Args:
norb: The number of spatial orbitals.
- occupied_orbitals: A pair of lists of integers. The first list specifies
- the occupied alpha orbitals and the second list specifies the occupied
- beta orbitals.
- orbital_rotation: An optional orbital rotation to apply to the
- electron configuration. In other words, this is a unitary matrix that
- describes the orbitals of the Slater determinant.
+ occupied_orbitals: The occupied orbitals in the electonic configuration.
+ This is a pair of lists of integers, where the first list specifies the
+ spin alpha orbitals and the second list specifies the spin beta
+ orbitals.
+ orbital_rotation: The orbital rotation. You can pass either a single Numpy
+ array specifying the orbital rotation to apply to both spin sectors, or
+ you can pass a pair of Numpy arrays to specify independent orbital
+ rotations for spin alpha and spin beta.
Returns:
The Slater determinant as a statevector.
@@ -337,7 +350,28 @@ Source code for ffsim.states.states
beta_index = cistring.str2addr(norb, n_beta, beta_string)
vec = one_hot((dim1, dim2), (alpha_index, beta_index), dtype=complex).reshape(-1)
if orbital_rotation is not None:
- vec = apply_orbital_rotation(vec, orbital_rotation, norb=norb, nelec=nelec)
+ if isinstance(orbital_rotation, np.ndarray):
+ vec = apply_orbital_rotation(
+ vec, orbital_rotation, norb=norb, nelec=nelec, copy=False
+ )
+ else:
+ orbital_rotation_a, orbital_rotation_b = orbital_rotation
+ vec = apply_orbital_rotation(
+ vec,
+ orbital_rotation_a,
+ norb=norb,
+ nelec=nelec,
+ spin=Spin.ALPHA,
+ copy=False,
+ )
+ vec = apply_orbital_rotation(
+ vec,
+ orbital_rotation_b,
+ norb=norb,
+ nelec=nelec,
+ spin=Spin.BETA,
+ copy=False,
+ )
return vec
@@ -366,28 +400,33 @@ Source code for ffsim.states.states
def slater_determinant_rdm(
norb: int,
occupied_orbitals: tuple[Sequence[int], Sequence[int]],
- orbital_rotation: np.ndarray | None = None,
+ orbital_rotation: np.ndarray | tuple[np.ndarray, np.ndarray] | None = None,
rank: int = 1,
spin_summed: bool = True,
) -> np.ndarray:
- """Return the reduced density matrix of a Slater determinant.
+ """Return the reduced density matrix of a `Slater determinant`_.
Note:
Currently, only rank 1 is supported.
Args:
norb: The number of spatial orbitals.
- occupied_orbitals: A tuple of two sequences of integers. The first
- sequence contains the indices of the occupied alpha orbitals, and
- the second sequence similarly for the beta orbitals.
- orbital_rotation: An optional orbital rotation to apply to the
- electron configuration. In other words, this is a unitary matrix that
- describes the orbitals of the Slater determinant.
- rank: The rank of the reduced density matrix.
+ occupied_orbitals: The occupied orbitals in the electonic configuration.
+ This is a pair of lists of integers, where the first list specifies the
+ spin alpha orbitals and the second list specifies the spin beta
+ orbitals.
+ orbital_rotation: The orbital rotation. You can pass either a single Numpy
+ array specifying the orbital rotation to apply to both spin sectors, or
+ you can pass a pair of Numpy arrays to specify independent orbital
+ rotations for spin alpha and spin beta.
+ rank: The rank of the reduced density matrix. I.e., rank 1 corresponds to the
+ one-particle RDM, rank 2 corresponds to the 2-particle RDM, etc.
spin_summed: Whether to sum over the spin index.
Returns:
The reduced density matrix of the Slater determinant.
+
+ .. _Slater determinant: ffsim.html#ffsim.slater_determinant
"""
if rank == 1:
rdm_a = np.zeros((norb, norb), dtype=complex)
@@ -399,8 +438,13 @@ Source code for ffsim.states.states
if len(beta_orbitals):
rdm_b[(beta_orbitals, beta_orbitals)] = 1
if orbital_rotation is not None:
- rdm_a = orbital_rotation.conj() @ rdm_a @ orbital_rotation.T
- rdm_b = orbital_rotation.conj() @ rdm_b @ orbital_rotation.T
+ if isinstance(orbital_rotation, np.ndarray):
+ orbital_rotation_a = orbital_rotation
+ orbital_rotation_b = orbital_rotation
+ else:
+ orbital_rotation_a, orbital_rotation_b = orbital_rotation
+ rdm_a = orbital_rotation_a.conj() @ rdm_a @ orbital_rotation_a.T
+ rdm_b = orbital_rotation_b.conj() @ rdm_b @ orbital_rotation_b.T
if spin_summed:
return rdm_a + rdm_b
return scipy.linalg.block_diag(rdm_a, rdm_b)
diff --git a/api/ffsim.html b/api/ffsim.html
index af4e6ff13..3e8390eda 100644
--- a/api/ffsim.html
+++ b/api/ffsim.html
@@ -2796,16 +2796,26 @@
ffsim.slater_determinant(norb, occupied_orbitals, orbital_rotation=None)[source]¶
Return a Slater determinant.
+A Slater determinant is a state of the form
+
+
+\[\mathcal{U} \lvert x \rangle,\]
+
+where \(\mathcal{U}\) is an
+orbital rotation and
+\(\lvert x \rangle\) is an electronic configuration.
- Parameters:
norb (int
) – The number of spatial orbitals.
-occupied_orbitals (tuple
[Sequence
[int
], Sequence
[int
]]) – A pair of lists of integers. The first list specifies
-the occupied alpha orbitals and the second list specifies the occupied
-beta orbitals.
-orbital_rotation (ndarray
| None
) – An optional orbital rotation to apply to the
-electron configuration. In other words, this is a unitary matrix that
-describes the orbitals of the Slater determinant.
+occupied_orbitals (tuple
[Sequence
[int
], Sequence
[int
]]) – The occupied orbitals in the electonic configuration.
+This is a pair of lists of integers, where the first list specifies the
+spin alpha orbitals and the second list specifies the spin beta
+orbitals.
+orbital_rotation (ndarray
| tuple
[ndarray
, ndarray
] | None
) – The orbital rotation. You can pass either a single Numpy
+array specifying the orbital rotation to apply to both spin sectors, or
+you can pass a pair of Numpy arrays to specify independent orbital
+rotations for spin alpha and spin beta.
- Return type:
@@ -2820,7 +2830,7 @@
-
ffsim.slater_determinant_rdm(norb, occupied_orbitals, orbital_rotation=None, rank=1, spin_summed=True)[source]¶
-Return the reduced density matrix of a Slater determinant.
+Return the reduced density matrix of a Slater determinant.
Note
Currently, only rank 1 is supported.
@@ -2829,13 +2839,16 @@
- Parameters:
norb (int
) – The number of spatial orbitals.
-occupied_orbitals (tuple
[Sequence
[int
], Sequence
[int
]]) – A tuple of two sequences of integers. The first
-sequence contains the indices of the occupied alpha orbitals, and
-the second sequence similarly for the beta orbitals.
-orbital_rotation (ndarray
| None
) – An optional orbital rotation to apply to the
-electron configuration. In other words, this is a unitary matrix that
-describes the orbitals of the Slater determinant.
-rank (int
) – The rank of the reduced density matrix.
+occupied_orbitals (tuple
[Sequence
[int
], Sequence
[int
]]) – The occupied orbitals in the electonic configuration.
+This is a pair of lists of integers, where the first list specifies the
+spin alpha orbitals and the second list specifies the spin beta
+orbitals.
+orbital_rotation (ndarray
| tuple
[ndarray
, ndarray
] | None
) – The orbital rotation. You can pass either a single Numpy
+array specifying the orbital rotation to apply to both spin sectors, or
+you can pass a pair of Numpy arrays to specify independent orbital
+rotations for spin alpha and spin beta.
+rank (int
) – The rank of the reduced density matrix. I.e., rank 1 corresponds to the
+one-particle RDM, rank 2 corresponds to the 2-particle RDM, etc.
spin_summed (bool
) – Whether to sum over the spin index.
diff --git a/api/ffsim.qiskit.html b/api/ffsim.qiskit.html
index 8fe3ab23f..2e333670e 100644
--- a/api/ffsim.qiskit.html
+++ b/api/ffsim.qiskit.html
@@ -431,10 +431,10 @@
where \(\mathcal{U}\) is an
orbital rotation and
-\(\lvert x \rangle\) is a computational basis state. The reason this gate
-exists (when OrbitalRotationJW
already exists) is that the preparation
-of a Slater determinant has a more optimized circuit than a generic orbital
-rotation.
+\(\lvert x \rangle\) is an electronic configuration (computational basis state).
+The reason this gate exists (when OrbitalRotationJW
already exists) is that
+the preparation of a Slater determinant has a more optimized circuit than a generic
+orbital rotation.
This gate is meant to be applied to the all zeros state. Its behavior when applied
to any other state is not guaranteed. The global phase of the prepared state may
be arbitrary.
@@ -450,12 +450,14 @@
- Parameters:
norb (int
) – The number of spatial orbitals.
-occupied_orbitals (tuple
[Sequence
[int
], Sequence
[int
]]) – A pair of lists of integers. The first list specifies
-the occupied alpha orbitals and the second list specifies the occupied
-beta orbitals.
-orbital_rotation (ndarray
| None
) – An optional orbital rotation to apply to the
-electron configuration. In other words, this is a unitary matrix that
-describes the orbitals of the Slater determinant.
+occupied_orbitals (tuple
[Sequence
[int
], Sequence
[int
]]) – The occupied orbitals in the electonic configuration.
+This is a pair of lists of integers, where the first list specifies the
+spin alpha orbitals and the second list specifies the spin beta
+orbitals.
+orbital_rotation (ndarray
| tuple
[ndarray
, ndarray
] | None
) – The orbital rotation. You can pass either a single Numpy
+array specifying the orbital rotation to apply to both spin sectors, or
+you can pass a pair of Numpy arrays to specify independent orbital
+rotations for spin alpha and spin beta.
label (str
| None
) – The label of the gate.
validate (bool
) – Whether to validate the inputs.
rtol (float
) – Relative numerical tolerance for input validation.
diff --git a/explanations/hamiltonians.html b/explanations/hamiltonians.html
index 92b6f73aa..a3dabd8b3 100644
--- a/explanations/hamiltonians.html
+++ b/explanations/hamiltonians.html
@@ -322,7 +322,7 @@ Operator action via SciPy LinearOperators
--99.55717072551575
+-99.55717072551572
Time evolution by the Hamiltonian can be computed using expm_multiply
:
@@ -340,7 +340,7 @@ Operator action via SciPy LinearOperators
-/tmp/ipykernel_4374/2190712273.py:2: UserWarning: Trace of LinearOperator not available, it will be estimated. Provide `traceA` to ensure performance.
+/tmp/ipykernel_4397/2190712273.py:2: UserWarning: Trace of LinearOperator not available, it will be estimated. Provide `traceA` to ensure performance.
evolved_vec = scipy.sparse.linalg.expm_multiply(-1j * time * linop, vec)
diff --git a/explanations/hamiltonians.ipynb b/explanations/hamiltonians.ipynb
index e1c1f2a94..dc782d0d9 100644
--- a/explanations/hamiltonians.ipynb
+++ b/explanations/hamiltonians.ipynb
@@ -33,10 +33,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:45.177839Z",
- "iopub.status.busy": "2024-04-29T11:29:45.177394Z",
- "iopub.status.idle": "2024-04-29T11:29:45.793060Z",
- "shell.execute_reply": "2024-04-29T11:29:45.792468Z"
+ "iopub.execute_input": "2024-04-29T12:27:27.786789Z",
+ "iopub.status.busy": "2024-04-29T12:27:27.786334Z",
+ "iopub.status.idle": "2024-04-29T12:27:28.387057Z",
+ "shell.execute_reply": "2024-04-29T12:27:28.386518Z"
}
},
"outputs": [],
@@ -68,10 +68,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:45.796015Z",
- "iopub.status.busy": "2024-04-29T11:29:45.795538Z",
- "iopub.status.idle": "2024-04-29T11:29:45.798490Z",
- "shell.execute_reply": "2024-04-29T11:29:45.798019Z"
+ "iopub.execute_input": "2024-04-29T12:27:28.390029Z",
+ "iopub.status.busy": "2024-04-29T12:27:28.389557Z",
+ "iopub.status.idle": "2024-04-29T12:27:28.392532Z",
+ "shell.execute_reply": "2024-04-29T12:27:28.392055Z"
}
},
"outputs": [],
@@ -99,10 +99,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:45.800957Z",
- "iopub.status.busy": "2024-04-29T11:29:45.800585Z",
- "iopub.status.idle": "2024-04-29T11:29:45.803695Z",
- "shell.execute_reply": "2024-04-29T11:29:45.803188Z"
+ "iopub.execute_input": "2024-04-29T12:27:28.394787Z",
+ "iopub.status.busy": "2024-04-29T12:27:28.394419Z",
+ "iopub.status.idle": "2024-04-29T12:27:28.397626Z",
+ "shell.execute_reply": "2024-04-29T12:27:28.397145Z"
}
},
"outputs": [],
@@ -127,10 +127,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:45.806123Z",
- "iopub.status.busy": "2024-04-29T11:29:45.805767Z",
- "iopub.status.idle": "2024-04-29T11:29:45.810606Z",
- "shell.execute_reply": "2024-04-29T11:29:45.810001Z"
+ "iopub.execute_input": "2024-04-29T12:27:28.399761Z",
+ "iopub.status.busy": "2024-04-29T12:27:28.399542Z",
+ "iopub.status.idle": "2024-04-29T12:27:28.404543Z",
+ "shell.execute_reply": "2024-04-29T12:27:28.403973Z"
}
},
"outputs": [],
@@ -152,17 +152,17 @@
"execution_count": 5,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:45.814166Z",
- "iopub.status.busy": "2024-04-29T11:29:45.813199Z",
- "iopub.status.idle": "2024-04-29T11:29:45.846198Z",
- "shell.execute_reply": "2024-04-29T11:29:45.845528Z"
+ "iopub.execute_input": "2024-04-29T12:27:28.407444Z",
+ "iopub.status.busy": "2024-04-29T12:27:28.406907Z",
+ "iopub.status.idle": "2024-04-29T12:27:28.437493Z",
+ "shell.execute_reply": "2024-04-29T12:27:28.436820Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
- "-99.55717072551575"
+ "-99.55717072551572"
]
},
"execution_count": 5,
@@ -191,10 +191,10 @@
"execution_count": 6,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:45.878148Z",
- "iopub.status.busy": "2024-04-29T11:29:45.877722Z",
- "iopub.status.idle": "2024-04-29T11:29:46.678755Z",
- "shell.execute_reply": "2024-04-29T11:29:46.678108Z"
+ "iopub.execute_input": "2024-04-29T12:27:28.471137Z",
+ "iopub.status.busy": "2024-04-29T12:27:28.470595Z",
+ "iopub.status.idle": "2024-04-29T12:27:29.239267Z",
+ "shell.execute_reply": "2024-04-29T12:27:29.238622Z"
}
},
"outputs": [
@@ -202,7 +202,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
- "/tmp/ipykernel_4374/2190712273.py:2: UserWarning: Trace of LinearOperator not available, it will be estimated. Provide `traceA` to ensure performance.\n",
+ "/tmp/ipykernel_4397/2190712273.py:2: UserWarning: Trace of LinearOperator not available, it will be estimated. Provide `traceA` to ensure performance.\n",
" evolved_vec = scipy.sparse.linalg.expm_multiply(-1j * time * linop, vec)\n"
]
}
@@ -224,10 +224,10 @@
"execution_count": 7,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:46.682776Z",
- "iopub.status.busy": "2024-04-29T11:29:46.681604Z",
- "iopub.status.idle": "2024-04-29T11:29:47.558188Z",
- "shell.execute_reply": "2024-04-29T11:29:47.557565Z"
+ "iopub.execute_input": "2024-04-29T12:27:29.243622Z",
+ "iopub.status.busy": "2024-04-29T12:27:29.242559Z",
+ "iopub.status.idle": "2024-04-29T12:27:30.127447Z",
+ "shell.execute_reply": "2024-04-29T12:27:30.126811Z"
}
},
"outputs": [],
diff --git a/explanations/orbital-rotation.ipynb b/explanations/orbital-rotation.ipynb
index 51b57323b..dbb16fa37 100644
--- a/explanations/orbital-rotation.ipynb
+++ b/explanations/orbital-rotation.ipynb
@@ -62,10 +62,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:49.231375Z",
- "iopub.status.busy": "2024-04-29T11:29:49.231182Z",
- "iopub.status.idle": "2024-04-29T11:29:49.834398Z",
- "shell.execute_reply": "2024-04-29T11:29:49.833870Z"
+ "iopub.execute_input": "2024-04-29T12:27:31.760549Z",
+ "iopub.status.busy": "2024-04-29T12:27:31.760341Z",
+ "iopub.status.idle": "2024-04-29T12:27:32.383573Z",
+ "shell.execute_reply": "2024-04-29T12:27:32.383042Z"
}
},
"outputs": [],
diff --git a/explanations/state-vectors-and-gates.ipynb b/explanations/state-vectors-and-gates.ipynb
index 6b56a514d..91da4dc33 100644
--- a/explanations/state-vectors-and-gates.ipynb
+++ b/explanations/state-vectors-and-gates.ipynb
@@ -26,10 +26,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:51.314778Z",
- "iopub.status.busy": "2024-04-29T11:29:51.314542Z",
- "iopub.status.idle": "2024-04-29T11:29:51.926253Z",
- "shell.execute_reply": "2024-04-29T11:29:51.925680Z"
+ "iopub.execute_input": "2024-04-29T12:27:33.730288Z",
+ "iopub.status.busy": "2024-04-29T12:27:33.729742Z",
+ "iopub.status.idle": "2024-04-29T12:27:34.351837Z",
+ "shell.execute_reply": "2024-04-29T12:27:34.351189Z"
}
},
"outputs": [
@@ -74,10 +74,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:51.928889Z",
- "iopub.status.busy": "2024-04-29T11:29:51.928412Z",
- "iopub.status.idle": "2024-04-29T11:29:51.935495Z",
- "shell.execute_reply": "2024-04-29T11:29:51.934993Z"
+ "iopub.execute_input": "2024-04-29T12:27:34.354453Z",
+ "iopub.status.busy": "2024-04-29T12:27:34.354020Z",
+ "iopub.status.idle": "2024-04-29T12:27:34.360926Z",
+ "shell.execute_reply": "2024-04-29T12:27:34.360417Z"
}
},
"outputs": [
@@ -118,10 +118,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:51.937801Z",
- "iopub.status.busy": "2024-04-29T11:29:51.937500Z",
- "iopub.status.idle": "2024-04-29T11:29:51.941902Z",
- "shell.execute_reply": "2024-04-29T11:29:51.941304Z"
+ "iopub.execute_input": "2024-04-29T12:27:34.363159Z",
+ "iopub.status.busy": "2024-04-29T12:27:34.362965Z",
+ "iopub.status.idle": "2024-04-29T12:27:34.367424Z",
+ "shell.execute_reply": "2024-04-29T12:27:34.366930Z"
}
},
"outputs": [
@@ -155,10 +155,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:51.944285Z",
- "iopub.status.busy": "2024-04-29T11:29:51.943826Z",
- "iopub.status.idle": "2024-04-29T11:29:51.948078Z",
- "shell.execute_reply": "2024-04-29T11:29:51.947594Z"
+ "iopub.execute_input": "2024-04-29T12:27:34.369733Z",
+ "iopub.status.busy": "2024-04-29T12:27:34.369382Z",
+ "iopub.status.idle": "2024-04-29T12:27:34.373426Z",
+ "shell.execute_reply": "2024-04-29T12:27:34.372952Z"
}
},
"outputs": [
@@ -197,10 +197,10 @@
"execution_count": 5,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:51.950503Z",
- "iopub.status.busy": "2024-04-29T11:29:51.950055Z",
- "iopub.status.idle": "2024-04-29T11:29:51.956400Z",
- "shell.execute_reply": "2024-04-29T11:29:51.955904Z"
+ "iopub.execute_input": "2024-04-29T12:27:34.375604Z",
+ "iopub.status.busy": "2024-04-29T12:27:34.375411Z",
+ "iopub.status.idle": "2024-04-29T12:27:34.381388Z",
+ "shell.execute_reply": "2024-04-29T12:27:34.380934Z"
}
},
"outputs": [
@@ -243,10 +243,10 @@
"execution_count": 6,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-04-29T11:29:51.958836Z",
- "iopub.status.busy": "2024-04-29T11:29:51.958458Z",
- "iopub.status.idle": "2024-04-29T11:29:51.963349Z",
- "shell.execute_reply": "2024-04-29T11:29:51.962789Z"
+ "iopub.execute_input": "2024-04-29T12:27:34.383486Z",
+ "iopub.status.busy": "2024-04-29T12:27:34.383295Z",
+ "iopub.status.idle": "2024-04-29T12:27:34.388557Z",
+ "shell.execute_reply": "2024-04-29T12:27:34.388077Z"
}
},
"outputs": [
diff --git a/how-to-guides/entanglement-forging.html b/how-to-guides/entanglement-forging.html
index b2c004a2b..3a3bbf0d3 100644
--- a/how-to-guides/entanglement-forging.html
+++ b/how-to-guides/entanglement-forging.html
@@ -369,7 +369,7 @@ Compute energy
-Energy at initialialization: -75.67794403659725
+Energy at initialialization: -75.67794403659722
FermionOperator({
- (cre_b(1), des_b(5), cre_a(4)): 1+1j,
+ (cre_a(0), des_a(3)): 0.5,
(cre_a(3), des_a(0)): -0.25,
- (cre_a(0), des_a(3)): 0.5
+ (cre_b(1), des_b(5), cre_a(4)): 1+1j
})
-'FermionOperator({((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 3), (False, False, 0)): -0.25+0j, ((True, False, 0), (False, False, 3)): 0.5+0j})'
+'FermionOperator({((True, False, 0), (False, False, 3)): 0.5+0j, ((True, False, 3), (False, False, 0)): -0.25+0j, ((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j})'
FermionOperators support arithmetic operations. Note that when multiplying a FermionOperator by a scalar, the scalar must go on the left, i.e. 2 * op
and not op * 2
.
FermionOperator({
- (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -0.25-0.25j,
+ (cre_a(3), des_a(0), des_a(3), des_b(3)): 0.0625,
(cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,
- (cre_a(3), des_a(0)): -0.5,
- (des_a(3), des_b(3)): 0.0625,
(cre_b(2)): 0-0.25j,
- (cre_a(0), des_a(3)): 1,
(cre_a(3), des_a(0), cre_b(2)): 0-0.25j,
+ (cre_a(3), des_a(0)): -0.5,
(cre_b(1), des_b(5), cre_a(4)): 2+2j,
- (cre_a(3), des_a(0), des_a(3), des_b(3)): 0.0625,
+ (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -0.25-0.25j,
(cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,
- (cre_a(0), des_a(3), cre_b(2)): 0+0.5j
+ (cre_a(0), des_a(3), cre_b(2)): 0+0.5j,
+ (cre_a(0), des_a(3)): 1,
+ (des_a(3), des_b(3)): 0.0625
})
FermionOperator({
- (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,
+ (cre_a(3), des_a(0), des_a(3), des_b(3)): 0-0.25j,
(cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,
- (cre_a(3), des_a(0)): 0+3j,
- (des_a(3), des_b(3)): 0-1.25j,
(cre_b(2)): -5,
- (cre_a(0), des_a(3)): 0-6j,
(cre_a(3), des_a(0), cre_b(2)): -1,
+ (cre_a(3), des_a(0)): 0+3j,
(cre_b(1), des_b(5), cre_a(4)): 12-12j,
- (cre_a(3), des_a(0), des_a(3), des_b(3)): 0-0.25j,
+ (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,
(cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,
- (cre_a(0), des_a(3), cre_b(2)): 2
+ (cre_a(0), des_a(3), cre_b(2)): 2,
+ (cre_a(0), des_a(3)): 0-6j,
+ (des_a(3), des_b(3)): 0-1.25j
})
FermionOperator({
- (cre_a(3), des_b(3), des_a(3), des_a(0)): 0+0.25j,
- (cre_a(0), des_a(3)): 0-6j,
+ (cre_b(2), cre_b(1), cre_a(4), des_b(5)): 4+4j,
(cre_b(2), cre_a(3), des_a(0)): -1,
- (cre_b(2)): -5,
- (cre_b(2), cre_a(0), des_a(3)): 2,
- (cre_a(3), des_a(0)): 0+3j,
(des_b(3), des_a(3)): 0+1.25j,
- (cre_b(1), cre_a(4), des_b(5), des_b(3), des_a(3)): -1+1j,
+ (cre_a(3), des_b(3), des_a(3), des_a(0)): 0+0.25j,
+ (cre_a(3), des_a(0)): 0+3j,
(cre_b(1), cre_a(4), des_b(5)): -12+12j,
- (cre_b(2), cre_b(1), cre_a(4), des_b(5)): 4+4j
+ (cre_b(1), cre_a(4), des_b(5), des_b(3), des_a(3)): -1+1j,
+ (cre_b(2)): -5,
+ (cre_b(2), cre_a(0), des_a(3)): 2,
+ (cre_a(0), des_a(3)): 0-6j
})
-array([0. +0.j , 0. +0.j ,
- 0. +0.j , 0. +0.j ,
- 0.02404118-0.0351354j, 0. +0.j ,
- 0. +0.j , 0. +0.j ,
- 0. +0.j ])
+array([ 0. +0.j , 0. +0.j ,
+ 0. +0.j , 0. +0.j ,
+ -0.08897206-0.09438409j, 0. +0.j ,
+ 0. +0.j , 0. +0.j ,
+ 0. +0.j ])
It can also be passed into most linear algebra routines in scipy.sparse.linalg
.
-E(CCSD) = -77.49387212754471 E_corr = -0.04824536314851305
+E(CCSD) = -77.49387212754468 E_corr = -0.04824536314851351
-Maximum error in a tensor entry: 0.036685417309834434
+Maximum error in a tensor entry: 0.036685417309834656
-Fidelity of Trotter-evolved state with exact state: 0.9402435386998327
+Fidelity of Trotter-evolved state with exact state: 0.9402393562171305
The fidelity of the final result can be improved by increasing the number of Trotter steps.
@@ -574,7 +574,7 @@
-Fidelity of Trotter-evolved state with exact state: 0.998521286151722
+Fidelity of Trotter-evolved state with exact state: 0.9985211214229683
In the code cell below, we reproduce the results of our manually implemented function using ffsim’s built-in implementation.
@@ -602,7 +602,7 @@
-Fidelity of Trotter-evolved state with exact state: 0.9985212861517185
+Fidelity of Trotter-evolved state with exact state: 0.9985211214229975
A higher order formula achieves a higher fidelity with fewer Trotter steps:
@@ -630,7 +630,7 @@
-Fidelity of Trotter-evolved state with exact state: 0.9996731164189284
+Fidelity of Trotter-evolved state with exact state: 0.9996731166933271
You’ve made it to the end of this tutorial!
diff --git a/tutorials/double-factorized-trotter.ipynb b/tutorials/double-factorized-trotter.ipynb index b8fefab92..40883e76e 100644 --- a/tutorials/double-factorized-trotter.ipynb +++ b/tutorials/double-factorized-trotter.ipynb @@ -18,10 +18,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:53.401657Z", - "iopub.status.busy": "2024-04-29T11:31:53.401204Z", - "iopub.status.idle": "2024-04-29T11:31:54.058194Z", - "shell.execute_reply": "2024-04-29T11:31:54.057609Z" + "iopub.execute_input": "2024-04-29T12:29:41.431200Z", + "iopub.status.busy": "2024-04-29T12:29:41.430997Z", + "iopub.status.idle": "2024-04-29T12:29:42.092292Z", + "shell.execute_reply": "2024-04-29T12:29:42.091658Z" } }, "outputs": [ @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.061249Z", - "iopub.status.busy": "2024-04-29T11:31:54.060704Z", - "iopub.status.idle": "2024-04-29T11:31:54.065083Z", - "shell.execute_reply": "2024-04-29T11:31:54.064500Z" + "iopub.execute_input": "2024-04-29T12:29:42.095377Z", + "iopub.status.busy": "2024-04-29T12:29:42.094795Z", + "iopub.status.idle": "2024-04-29T12:29:42.099198Z", + "shell.execute_reply": "2024-04-29T12:29:42.098618Z" } }, "outputs": [], @@ -105,10 +105,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.067656Z", - "iopub.status.busy": "2024-04-29T11:31:54.067279Z", - "iopub.status.idle": "2024-04-29T11:31:54.072307Z", - "shell.execute_reply": "2024-04-29T11:31:54.071780Z" + "iopub.execute_input": "2024-04-29T12:29:42.101757Z", + "iopub.status.busy": "2024-04-29T12:29:42.101398Z", + "iopub.status.idle": "2024-04-29T12:29:42.106500Z", + "shell.execute_reply": "2024-04-29T12:29:42.105993Z" } }, "outputs": [ @@ -171,10 +171,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.074538Z", - "iopub.status.busy": "2024-04-29T11:31:54.074185Z", - "iopub.status.idle": "2024-04-29T11:31:54.078718Z", - "shell.execute_reply": "2024-04-29T11:31:54.078122Z" + "iopub.execute_input": "2024-04-29T12:29:42.108873Z", + "iopub.status.busy": "2024-04-29T12:29:42.108532Z", + "iopub.status.idle": "2024-04-29T12:29:42.113165Z", + "shell.execute_reply": "2024-04-29T12:29:42.112544Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.080938Z", - "iopub.status.busy": "2024-04-29T11:31:54.080747Z", - "iopub.status.idle": "2024-04-29T11:31:54.084742Z", - "shell.execute_reply": "2024-04-29T11:31:54.084247Z" + "iopub.execute_input": "2024-04-29T12:29:42.115291Z", + "iopub.status.busy": "2024-04-29T12:29:42.115096Z", + "iopub.status.idle": "2024-04-29T12:29:42.119008Z", + "shell.execute_reply": "2024-04-29T12:29:42.118412Z" } }, "outputs": [ @@ -241,10 +241,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.087008Z", - "iopub.status.busy": "2024-04-29T11:31:54.086650Z", - "iopub.status.idle": "2024-04-29T11:31:54.105086Z", - "shell.execute_reply": "2024-04-29T11:31:54.104616Z" + "iopub.execute_input": "2024-04-29T12:29:42.121247Z", + "iopub.status.busy": "2024-04-29T12:29:42.121060Z", + "iopub.status.idle": "2024-04-29T12:29:42.139791Z", + "shell.execute_reply": "2024-04-29T12:29:42.139177Z" } }, "outputs": [ @@ -252,7 +252,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Maximum error in a tensor entry: 0.036685417309834434\n" + "Maximum error in a tensor entry: 0.036685417309834656\n" ] } ], @@ -301,10 +301,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.107450Z", - "iopub.status.busy": "2024-04-29T11:31:54.106964Z", - "iopub.status.idle": "2024-04-29T11:31:54.111330Z", - "shell.execute_reply": "2024-04-29T11:31:54.110832Z" + "iopub.execute_input": "2024-04-29T12:29:42.142152Z", + "iopub.status.busy": "2024-04-29T12:29:42.141790Z", + "iopub.status.idle": "2024-04-29T12:29:42.146634Z", + "shell.execute_reply": "2024-04-29T12:29:42.146002Z" } }, "outputs": [], @@ -359,10 +359,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.113376Z", - "iopub.status.busy": "2024-04-29T11:31:54.113183Z", - "iopub.status.idle": "2024-04-29T11:31:54.116626Z", - "shell.execute_reply": "2024-04-29T11:31:54.116164Z" + "iopub.execute_input": "2024-04-29T12:29:42.149048Z", + "iopub.status.busy": "2024-04-29T12:29:42.148677Z", + "iopub.status.idle": "2024-04-29T12:29:42.152301Z", + "shell.execute_reply": "2024-04-29T12:29:42.151810Z" } }, "outputs": [], @@ -399,10 +399,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:54.118760Z", - "iopub.status.busy": "2024-04-29T11:31:54.118550Z", - "iopub.status.idle": "2024-04-29T11:31:57.082872Z", - "shell.execute_reply": "2024-04-29T11:31:57.082221Z" + "iopub.execute_input": "2024-04-29T12:29:42.154510Z", + "iopub.status.busy": "2024-04-29T12:29:42.154171Z", + "iopub.status.idle": "2024-04-29T12:29:45.128898Z", + "shell.execute_reply": "2024-04-29T12:29:45.128243Z" } }, "outputs": [], @@ -438,10 +438,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.086304Z", - "iopub.status.busy": "2024-04-29T11:31:57.085850Z", - "iopub.status.idle": "2024-04-29T11:31:57.170646Z", - "shell.execute_reply": "2024-04-29T11:31:57.169978Z" + "iopub.execute_input": "2024-04-29T12:29:45.132287Z", + "iopub.status.busy": "2024-04-29T12:29:45.131875Z", + "iopub.status.idle": "2024-04-29T12:29:45.221794Z", + "shell.execute_reply": "2024-04-29T12:29:45.221229Z" } }, "outputs": [ @@ -449,7 +449,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9402435386998327\n" + "Fidelity of Trotter-evolved state with exact state: 0.9402393562171305\n" ] } ], @@ -479,10 +479,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.173582Z", - "iopub.status.busy": "2024-04-29T11:31:57.173358Z", - "iopub.status.idle": "2024-04-29T11:31:57.473983Z", - "shell.execute_reply": "2024-04-29T11:31:57.473356Z" + "iopub.execute_input": "2024-04-29T12:29:45.224698Z", + "iopub.status.busy": "2024-04-29T12:29:45.224266Z", + "iopub.status.idle": "2024-04-29T12:29:45.549121Z", + "shell.execute_reply": "2024-04-29T12:29:45.548546Z" } }, "outputs": [ @@ -490,7 +490,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.998521286151722\n" + "Fidelity of Trotter-evolved state with exact state: 0.9985211214229683\n" ] } ], @@ -520,10 +520,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.501012Z", - "iopub.status.busy": "2024-04-29T11:31:57.499862Z", - "iopub.status.idle": "2024-04-29T11:31:57.779011Z", - "shell.execute_reply": "2024-04-29T11:31:57.778445Z" + "iopub.execute_input": "2024-04-29T12:29:45.552137Z", + "iopub.status.busy": "2024-04-29T12:29:45.551663Z", + "iopub.status.idle": "2024-04-29T12:29:45.834944Z", + "shell.execute_reply": "2024-04-29T12:29:45.834355Z" } }, "outputs": [ @@ -531,7 +531,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9985212861517185\n" + "Fidelity of Trotter-evolved state with exact state: 0.9985211214229975\n" ] } ], @@ -562,10 +562,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-04-29T11:31:57.783749Z", - "iopub.status.busy": "2024-04-29T11:31:57.782767Z", - "iopub.status.idle": "2024-04-29T11:31:57.999128Z", - "shell.execute_reply": "2024-04-29T11:31:57.998592Z" + "iopub.execute_input": "2024-04-29T12:29:45.839258Z", + "iopub.status.busy": "2024-04-29T12:29:45.838261Z", + "iopub.status.idle": "2024-04-29T12:29:46.066669Z", + "shell.execute_reply": "2024-04-29T12:29:46.066059Z" } }, "outputs": [ @@ -573,7 +573,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9996731164189284\n" + "Fidelity of Trotter-evolved state with exact state: 0.9996731166933271\n" ] } ],