diff --git a/.doctrees/api/generated/ffsim.hamiltonians.doctree b/.doctrees/api/generated/ffsim.hamiltonians.doctree index 2e9222967..dfbf3127e 100644 Binary files a/.doctrees/api/generated/ffsim.hamiltonians.doctree and b/.doctrees/api/generated/ffsim.hamiltonians.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index ee0cba34d..5a38fd6ef 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/nbsphinx/tutorials/01-introduction.ipynb b/.doctrees/nbsphinx/tutorials/01-introduction.ipynb index b46f68b04..9ba68d884 100644 --- a/.doctrees/nbsphinx/tutorials/01-introduction.ipynb +++ b/.doctrees/nbsphinx/tutorials/01-introduction.ipynb @@ -16,10 +16,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:55.333137Z", - "iopub.status.busy": "2023-10-19T14:39:55.332800Z", - "iopub.status.idle": "2023-10-19T14:39:55.620635Z", - "shell.execute_reply": "2023-10-19T14:39:55.620092Z" + "iopub.execute_input": "2023-10-19T16:27:36.509941Z", + "iopub.status.busy": "2023-10-19T16:27:36.509492Z", + "iopub.status.idle": "2023-10-19T16:27:36.878359Z", + "shell.execute_reply": "2023-10-19T16:27:36.877646Z" } }, "outputs": [], @@ -62,10 +62,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:55.625193Z", - "iopub.status.busy": "2023-10-19T14:39:55.624119Z", - "iopub.status.idle": "2023-10-19T14:39:55.629183Z", - "shell.execute_reply": "2023-10-19T14:39:55.628710Z" + "iopub.execute_input": "2023-10-19T16:27:36.884089Z", + "iopub.status.busy": "2023-10-19T16:27:36.882169Z", + "iopub.status.idle": "2023-10-19T16:27:36.888779Z", + "shell.execute_reply": "2023-10-19T16:27:36.888221Z" } }, "outputs": [], @@ -93,10 +93,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:55.633035Z", - "iopub.status.busy": "2023-10-19T14:39:55.632089Z", - "iopub.status.idle": "2023-10-19T14:39:55.636031Z", - "shell.execute_reply": "2023-10-19T14:39:55.635577Z" + "iopub.execute_input": "2023-10-19T16:27:36.893261Z", + "iopub.status.busy": "2023-10-19T16:27:36.892022Z", + "iopub.status.idle": "2023-10-19T16:27:36.896757Z", + "shell.execute_reply": "2023-10-19T16:27:36.896155Z" } }, "outputs": [], diff --git a/.doctrees/nbsphinx/tutorials/02-orbital-rotation.ipynb b/.doctrees/nbsphinx/tutorials/02-orbital-rotation.ipynb index be6e21fe5..9a019f00c 100644 --- a/.doctrees/nbsphinx/tutorials/02-orbital-rotation.ipynb +++ b/.doctrees/nbsphinx/tutorials/02-orbital-rotation.ipynb @@ -43,10 +43,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.127490Z", - "iopub.status.busy": "2023-10-19T14:39:57.127250Z", - "iopub.status.idle": "2023-10-19T14:39:57.415242Z", - "shell.execute_reply": "2023-10-19T14:39:57.414684Z" + "iopub.execute_input": "2023-10-19T16:27:38.740446Z", + "iopub.status.busy": "2023-10-19T16:27:38.740199Z", + "iopub.status.idle": "2023-10-19T16:27:39.133772Z", + "shell.execute_reply": "2023-10-19T16:27:39.133089Z" } }, "outputs": [], @@ -111,10 +111,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.419456Z", - "iopub.status.busy": "2023-10-19T14:39:57.418437Z", - "iopub.status.idle": "2023-10-19T14:39:57.443882Z", - "shell.execute_reply": "2023-10-19T14:39:57.443356Z" + "iopub.execute_input": "2023-10-19T16:27:39.139249Z", + "iopub.status.busy": "2023-10-19T16:27:39.137973Z", + "iopub.status.idle": "2023-10-19T16:27:39.170534Z", + "shell.execute_reply": "2023-10-19T16:27:39.169918Z" } }, "outputs": [], @@ -160,10 +160,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.447969Z", - "iopub.status.busy": "2023-10-19T14:39:57.447021Z", - "iopub.status.idle": "2023-10-19T14:39:57.458057Z", - "shell.execute_reply": "2023-10-19T14:39:57.457553Z" + "iopub.execute_input": "2023-10-19T16:27:39.175431Z", + "iopub.status.busy": "2023-10-19T16:27:39.174296Z", + "iopub.status.idle": "2023-10-19T16:27:39.187414Z", + "shell.execute_reply": "2023-10-19T16:27:39.186695Z" } }, "outputs": [], @@ -203,10 +203,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.462338Z", - "iopub.status.busy": "2023-10-19T14:39:57.461004Z", - "iopub.status.idle": "2023-10-19T14:39:57.467050Z", - "shell.execute_reply": "2023-10-19T14:39:57.466562Z" + "iopub.execute_input": "2023-10-19T16:27:39.192482Z", + "iopub.status.busy": "2023-10-19T16:27:39.190867Z", + "iopub.status.idle": "2023-10-19T16:27:39.197986Z", + "shell.execute_reply": "2023-10-19T16:27:39.197420Z" } }, "outputs": [], diff --git a/.doctrees/nbsphinx/tutorials/03-double-factorized.ipynb b/.doctrees/nbsphinx/tutorials/03-double-factorized.ipynb index 2cb8abca1..09532880c 100644 --- a/.doctrees/nbsphinx/tutorials/03-double-factorized.ipynb +++ b/.doctrees/nbsphinx/tutorials/03-double-factorized.ipynb @@ -43,10 +43,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:58.908837Z", - "iopub.status.busy": "2023-10-19T14:39:58.908499Z", - "iopub.status.idle": "2023-10-19T14:39:59.292292Z", - "shell.execute_reply": "2023-10-19T14:39:59.291735Z" + "iopub.execute_input": "2023-10-19T16:27:41.295062Z", + "iopub.status.busy": "2023-10-19T16:27:41.294805Z", + "iopub.status.idle": "2023-10-19T16:27:41.768940Z", + "shell.execute_reply": "2023-10-19T16:27:41.768320Z" } }, "outputs": [ @@ -78,14 +78,16 @@ "mol_hamiltonian = mol_data.hamiltonian\n", "\n", "# Get the Hamiltonian in the double-factorized representation\n", - "df_hamiltonian = ffsim.double_factorized_hamiltonian(mol_hamiltonian)" + "df_hamiltonian = ffsim.DoubleFactorizedHamiltonian.from_molecular_hamiltonian(\n", + " mol_hamiltonian\n", + ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The function `double_factorized_hamiltonian` returns an object of type `DoubleFactorizedHamiltonian` which is just a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations." + "Here, `mol_hamiltonian` is an instance of `MolecularHamiltonian`, a dataclass that stores the one- and two-body tensors, and `df_hamiltonian` is an instance of `DoubleFactorizedHamiltonian`, a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations." ] }, { @@ -93,10 +95,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.296046Z", - "iopub.status.busy": "2023-10-19T14:39:59.295505Z", - "iopub.status.idle": "2023-10-19T14:39:59.303680Z", - "shell.execute_reply": "2023-10-19T14:39:59.303208Z" + "iopub.execute_input": "2023-10-19T16:27:41.797788Z", + "iopub.status.busy": "2023-10-19T16:27:41.796959Z", + "iopub.status.idle": "2023-10-19T16:27:41.805806Z", + "shell.execute_reply": "2023-10-19T16:27:41.805115Z" } }, "outputs": [ @@ -111,44 +113,44 @@ " [-3.07220771e-16 -6.77238770e-01]]\n", "\n", "Two-body tensor:\n", - "[[[[5.23173938e-01 1.94289029e-16]\n", - " [1.94289029e-16 5.33545754e-01]]\n", + "[[[[5.23173938e-01 1.57437591e-16]\n", + " [1.57437591e-16 5.33545754e-01]]\n", "\n", - " [[1.94289029e-16 2.48240570e-01]\n", - " [2.48240570e-01 8.32667268e-17]]]\n", + " [[2.12704463e-16 2.48240570e-01]\n", + " [2.48240570e-01 1.61492903e-16]]]\n", "\n", "\n", - " [[[1.94289029e-16 2.48240570e-01]\n", - " [2.48240570e-01 8.32667268e-17]]\n", + " [[[2.12704463e-16 2.48240570e-01]\n", + " [2.48240570e-01 1.61492903e-16]]\n", "\n", - " [[5.33545754e-01 1.11022302e-16]\n", - " [1.11022302e-16 5.53132024e-01]]]]\n", + " [[5.33545754e-01 1.24884750e-16]\n", + " [1.24884750e-16 5.53132024e-01]]]]\n", "\n", "Double-factorized representation\n", "--------------------------------\n", "One-body tensor:\n", - "[[-1.21318608e+00 -4.05183033e-16]\n", - " [-4.59876437e-16 -1.07792507e+00]]\n", + "[[-1.21318608e+00 -4.25870402e-16]\n", + " [-4.76015378e-16 -1.07792507e+00]]\n", "\n", "Diagonal Coulomb matrices:\n", - "[[[ 5.14653029e-001 5.33545754e-001]\n", - " [ 5.33545754e-001 5.53132024e-001]]\n", + "[[[ 5.14653029e-01 5.33545754e-01]\n", + " [ 5.33545754e-01 5.53132024e-01]]\n", "\n", - " [[ 2.48240570e-001 -2.48240570e-001]\n", - " [-2.48240570e-001 2.48240570e-001]]\n", + " [[ 2.48240570e-01 -2.48240570e-01]\n", + " [-2.48240570e-01 2.48240570e-01]]\n", "\n", - " [[ 5.96958401e-121 -7.13206008e-062]\n", - " [-7.13206008e-062 8.52090881e-003]]]\n", + " [[ 1.50800163e-59 -3.58462611e-31]\n", + " [-3.58462611e-31 8.52090881e-03]]]\n", "\n", "Orbital rotations:\n", - "[[[-1.00000000e+00 4.25128053e-15]\n", - " [ 4.25128053e-15 1.00000000e+00]]\n", + "[[[-1.00000000e+00 8.24520980e-15]\n", + " [ 8.24520980e-15 1.00000000e+00]]\n", "\n", - " [[ 7.07106781e-01 -7.07106781e-01]\n", - " [-7.07106781e-01 -7.07106781e-01]]\n", + " [[-7.07106781e-01 -7.07106781e-01]\n", + " [ 7.07106781e-01 -7.07106781e-01]]\n", "\n", - " [[ 2.89310728e-30 -1.00000000e+00]\n", - " [-1.00000000e+00 -2.89310728e-30]]]\n" + " [[ 6.48603030e-15 -1.00000000e+00]\n", + " [-1.00000000e+00 -6.48603030e-15]]]\n" ] } ], @@ -227,10 +229,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.307553Z", - "iopub.status.busy": "2023-10-19T14:39:59.306455Z", - "iopub.status.idle": "2023-10-19T14:39:59.312345Z", - "shell.execute_reply": "2023-10-19T14:39:59.311867Z" + "iopub.execute_input": "2023-10-19T16:27:41.808878Z", + "iopub.status.busy": "2023-10-19T16:27:41.808498Z", + "iopub.status.idle": "2023-10-19T16:27:41.813796Z", + "shell.execute_reply": "2023-10-19T16:27:41.813248Z" } }, "outputs": [], @@ -285,10 +287,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.315343Z", - "iopub.status.busy": "2023-10-19T14:39:59.315133Z", - "iopub.status.idle": "2023-10-19T14:39:59.319932Z", - "shell.execute_reply": "2023-10-19T14:39:59.319386Z" + "iopub.execute_input": "2023-10-19T16:27:41.816718Z", + "iopub.status.busy": "2023-10-19T16:27:41.816364Z", + "iopub.status.idle": "2023-10-19T16:27:41.820574Z", + "shell.execute_reply": "2023-10-19T16:27:41.820031Z" } }, "outputs": [], @@ -325,10 +327,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.322653Z", - "iopub.status.busy": "2023-10-19T14:39:59.322251Z", - "iopub.status.idle": "2023-10-19T14:39:59.327160Z", - "shell.execute_reply": "2023-10-19T14:39:59.326695Z" + "iopub.execute_input": "2023-10-19T16:27:41.823525Z", + "iopub.status.busy": "2023-10-19T16:27:41.823163Z", + "iopub.status.idle": "2023-10-19T16:27:41.828409Z", + "shell.execute_reply": "2023-10-19T16:27:41.827885Z" } }, "outputs": [ @@ -336,7 +338,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Hartree Fock energy: -0.837796382593709\n" + "Hartree Fock energy: -0.8377963825937088\n" ] } ], @@ -367,10 +369,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.329875Z", - "iopub.status.busy": "2023-10-19T14:39:59.329325Z", - "iopub.status.idle": "2023-10-19T14:39:59.339042Z", - "shell.execute_reply": "2023-10-19T14:39:59.338412Z" + "iopub.execute_input": "2023-10-19T16:27:41.831595Z", + "iopub.status.busy": "2023-10-19T16:27:41.831104Z", + "iopub.status.idle": "2023-10-19T16:27:41.842211Z", + "shell.execute_reply": "2023-10-19T16:27:41.841656Z" } }, "outputs": [ @@ -409,10 +411,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.341671Z", - "iopub.status.busy": "2023-10-19T14:39:59.341479Z", - "iopub.status.idle": "2023-10-19T14:39:59.349853Z", - "shell.execute_reply": "2023-10-19T14:39:59.349232Z" + "iopub.execute_input": "2023-10-19T16:27:41.845098Z", + "iopub.status.busy": "2023-10-19T16:27:41.844747Z", + "iopub.status.idle": "2023-10-19T16:27:41.853809Z", + "shell.execute_reply": "2023-10-19T16:27:41.853262Z" } }, "outputs": [ @@ -420,7 +422,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9990275744083491\n" + "Fidelity of Trotter-evolved state with exact state: 0.999027574408349\n" ] } ], @@ -450,10 +452,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.353772Z", - "iopub.status.busy": "2023-10-19T14:39:59.353568Z", - "iopub.status.idle": "2023-10-19T14:39:59.390939Z", - "shell.execute_reply": "2023-10-19T14:39:59.389931Z" + "iopub.execute_input": "2023-10-19T16:27:41.856607Z", + "iopub.status.busy": "2023-10-19T16:27:41.856244Z", + "iopub.status.idle": "2023-10-19T16:27:41.899624Z", + "shell.execute_reply": "2023-10-19T16:27:41.898940Z" } }, "outputs": [ @@ -461,7 +463,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9999906233109653\n" + "Fidelity of Trotter-evolved state with exact state: 0.9999906233109657\n" ] } ], @@ -493,10 +495,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.393689Z", - "iopub.status.busy": "2023-10-19T14:39:59.393490Z", - "iopub.status.idle": "2023-10-19T14:39:59.425221Z", - "shell.execute_reply": "2023-10-19T14:39:59.424460Z" + "iopub.execute_input": "2023-10-19T16:27:41.902790Z", + "iopub.status.busy": "2023-10-19T16:27:41.902330Z", + "iopub.status.idle": "2023-10-19T16:27:41.945843Z", + "shell.execute_reply": "2023-10-19T16:27:41.945194Z" } }, "outputs": [ @@ -504,7 +506,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9999906233109653\n" + "Fidelity of Trotter-evolved state with exact state: 0.9999906233109657\n" ] } ], @@ -535,10 +537,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.427658Z", - "iopub.status.busy": "2023-10-19T14:39:59.427469Z", - "iopub.status.idle": "2023-10-19T14:39:59.443022Z", - "shell.execute_reply": "2023-10-19T14:39:59.442331Z" + "iopub.execute_input": "2023-10-19T16:27:41.949120Z", + "iopub.status.busy": "2023-10-19T16:27:41.948837Z", + "iopub.status.idle": "2023-10-19T16:27:41.967055Z", + "shell.execute_reply": "2023-10-19T16:27:41.966238Z" } }, "outputs": [ @@ -546,7 +548,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9999999336740059\n" + "Fidelity of Trotter-evolved state with exact state: 0.9999999336740057\n" ] } ], diff --git a/.doctrees/nbsphinx/tutorials/04-lucj.ipynb b/.doctrees/nbsphinx/tutorials/04-lucj.ipynb index 1d8185999..c1e1946d5 100644 --- a/.doctrees/nbsphinx/tutorials/04-lucj.ipynb +++ b/.doctrees/nbsphinx/tutorials/04-lucj.ipynb @@ -14,10 +14,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:40:01.376785Z", - "iopub.status.busy": "2023-10-19T14:40:01.376450Z", - "iopub.status.idle": "2023-10-19T14:40:01.984780Z", - "shell.execute_reply": "2023-10-19T14:40:01.984205Z" + "iopub.execute_input": "2023-10-19T16:27:44.173731Z", + "iopub.status.busy": "2023-10-19T16:27:44.173460Z", + "iopub.status.idle": "2023-10-19T16:27:44.890778Z", + "shell.execute_reply": "2023-10-19T16:27:44.890166Z" } }, "outputs": [ @@ -25,14 +25,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "converged SCF energy = -77.4456267643961\n" + "converged SCF energy = -77.4456267643962\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "CASCI E = -77.6290254326717 E(CI) = -3.57322412553863 S^2 = 0.0000000\n" + "CASCI E = -77.6290254326717 E(CI) = -3.57322412553862 S^2 = 0.0000000\n" ] } ], @@ -109,10 +109,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:40:01.990201Z", - "iopub.status.busy": "2023-10-19T14:40:01.988624Z", - "iopub.status.idle": "2023-10-19T14:40:02.504800Z", - "shell.execute_reply": "2023-10-19T14:40:02.504249Z" + "iopub.execute_input": "2023-10-19T16:27:44.897251Z", + "iopub.status.busy": "2023-10-19T16:27:44.895577Z", + "iopub.status.idle": "2023-10-19T16:27:45.598357Z", + "shell.execute_reply": "2023-10-19T16:27:45.597692Z" } }, "outputs": [ @@ -120,14 +120,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "E(CCSD) = -77.49387212754462 E_corr = -0.04824536314851573\n" + "E(CCSD) = -77.49387212754473 E_corr = -0.04824536314851328\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Energy at initialialization: -77.46975600021692\n" + "Energy at initialialization: -77.46975600021656\n" ] } ], @@ -177,10 +177,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:40:02.507719Z", - "iopub.status.busy": "2023-10-19T14:40:02.507477Z", - "iopub.status.idle": "2023-10-19T14:41:13.658634Z", - "shell.execute_reply": "2023-10-19T14:41:13.658109Z" + "iopub.execute_input": "2023-10-19T16:27:45.601966Z", + "iopub.status.busy": "2023-10-19T16:27:45.601316Z", + "iopub.status.idle": "2023-10-19T16:29:31.891294Z", + "shell.execute_reply": "2023-10-19T16:29:31.890594Z" } }, "outputs": [ @@ -192,12 +192,12 @@ " message: CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH\n", " success: True\n", " status: 0\n", - " fun: -77.62873343946598\n", - " x: [-2.541e-01 -8.978e-02 ... 2.239e-01 -5.438e-01]\n", - " nit: 329\n", - " jac: [ 6.537e-05 3.098e-04 ... 2.956e-04 -1.734e-04]\n", - " nfev: 25696\n", - " njev: 352\n", + " fun: -77.62901334909452\n", + " x: [-4.597e-01 -2.974e-01 ... 3.896e-01 1.161e+00]\n", + " nit: 403\n", + " jac: [ 9.521e-05 2.245e-04 ... 1.236e-04 -4.150e-04]\n", + " nfev: 31682\n", + " njev: 434\n", " hess_inv: <72x72 LbfgsInvHessProduct with dtype=float64>\n" ] } @@ -252,10 +252,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:41:13.662631Z", - "iopub.status.busy": "2023-10-19T14:41:13.661664Z", - "iopub.status.idle": "2023-10-19T14:42:35.356542Z", - "shell.execute_reply": "2023-10-19T14:42:35.356016Z" + "iopub.execute_input": "2023-10-19T16:29:31.895316Z", + "iopub.status.busy": "2023-10-19T16:29:31.894949Z", + "iopub.status.idle": "2023-10-19T16:30:19.776632Z", + "shell.execute_reply": "2023-10-19T16:30:19.776089Z" } }, "outputs": [ @@ -267,12 +267,12 @@ " message: CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH\n", " success: True\n", " status: 0\n", - " fun: -77.62881470757267\n", - " x: [-3.795e+00 -1.386e+00 ... -4.020e-01 1.230e-01]\n", - " nit: 585\n", - " jac: [ 4.434e-04 -1.933e-04 ... 4.007e-04 -1.450e-04]\n", - " nfev: 29422\n", - " njev: 626\n", + " fun: -77.62873223663462\n", + " x: [-1.942e+00 3.888e-01 ... 3.479e-01 -8.915e-02]\n", + " nit: 285\n", + " jac: [ 1.563e-05 3.695e-05 ... -1.279e-05 -1.776e-04]\n", + " nfev: 14335\n", + " njev: 305\n", " hess_inv: <46x46 LbfgsInvHessProduct with dtype=float64>\n" ] } diff --git a/.doctrees/nbsphinx/tutorials/05-fermion-operator.ipynb b/.doctrees/nbsphinx/tutorials/05-fermion-operator.ipynb index fa09bcb38..e5cda2ddd 100644 --- a/.doctrees/nbsphinx/tutorials/05-fermion-operator.ipynb +++ b/.doctrees/nbsphinx/tutorials/05-fermion-operator.ipynb @@ -29,10 +29,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.077633Z", - "iopub.status.busy": "2023-10-19T14:42:37.077306Z", - "iopub.status.idle": "2023-10-19T14:42:37.362479Z", - "shell.execute_reply": "2023-10-19T14:42:37.361769Z" + "iopub.execute_input": "2023-10-19T16:30:21.670393Z", + "iopub.status.busy": "2023-10-19T16:30:21.669989Z", + "iopub.status.idle": "2023-10-19T16:30:22.023880Z", + "shell.execute_reply": "2023-10-19T16:30:22.023224Z" } }, "outputs": [ @@ -40,8 +40,8 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_a(0), des_a(3)): 0.5,\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", "})" ] @@ -76,17 +76,17 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.367296Z", - "iopub.status.busy": "2023-10-19T14:42:37.366261Z", - "iopub.status.idle": "2023-10-19T14:42:37.372138Z", - "shell.execute_reply": "2023-10-19T14:42:37.371678Z" + "iopub.execute_input": "2023-10-19T16:30:22.028811Z", + "iopub.status.busy": "2023-10-19T16:30:22.027408Z", + "iopub.status.idle": "2023-10-19T16:30:22.034307Z", + "shell.execute_reply": "2023-10-19T16:30:22.033759Z" } }, "outputs": [ { "data": { "text/plain": [ - "'FermionOperator({((True, False, 0), (False, False, 3)): 0.5+0j, ((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 3), (False, False, 0)): -0.25+0j})'" + "'FermionOperator({((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 0), (False, False, 3)): 0.5+0j, ((True, False, 3), (False, False, 0)): -0.25+0j})'" ] }, "execution_count": 2, @@ -110,10 +110,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.375800Z", - "iopub.status.busy": "2023-10-19T14:42:37.374921Z", - "iopub.status.idle": "2023-10-19T14:42:37.381567Z", - "shell.execute_reply": "2023-10-19T14:42:37.381116Z" + "iopub.execute_input": "2023-10-19T16:30:22.037944Z", + "iopub.status.busy": "2023-10-19T16:30:22.037568Z", + "iopub.status.idle": "2023-10-19T16:30:22.044977Z", + "shell.execute_reply": "2023-10-19T16:30:22.044445Z" } }, "outputs": [ @@ -122,16 +122,16 @@ "text/plain": [ "FermionOperator({\n", " (des_a(3), des_b(3)): 0.0625,\n", - " (cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,\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)): -0.5,\n", " (cre_a(0), des_a(3), cre_b(2)): 0+0.5j,\n", - " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,\n", - " (cre_a(0), des_a(3)): 1,\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_a(0), des_a(3)): 1,\n", " (cre_a(3), des_a(0), cre_b(2)): 0-0.25j,\n", - " (cre_b(2)): 0-0.25j\n", + " (cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,\n", + " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,\n", + " (cre_b(2)): 0-0.25j,\n", + " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -0.25-0.25j,\n", + " (cre_b(1), des_b(5), cre_a(4)): 2+2j,\n", + " (cre_a(3), des_a(0)): -0.5\n", "})" ] }, @@ -169,10 +169,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.385304Z", - "iopub.status.busy": "2023-10-19T14:42:37.384396Z", - "iopub.status.idle": "2023-10-19T14:42:37.390385Z", - "shell.execute_reply": "2023-10-19T14:42:37.389901Z" + "iopub.execute_input": "2023-10-19T16:30:22.049374Z", + "iopub.status.busy": "2023-10-19T16:30:22.048155Z", + "iopub.status.idle": "2023-10-19T16:30:22.054897Z", + "shell.execute_reply": "2023-10-19T16:30:22.054383Z" } }, "outputs": [ @@ -181,16 +181,16 @@ "text/plain": [ "FermionOperator({\n", " (des_a(3), des_b(3)): 0-1.25j,\n", - " (cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,\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)): 0+3j,\n", " (cre_a(0), des_a(3), cre_b(2)): 2,\n", - " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,\n", - " (cre_a(0), des_a(3)): 0-6j,\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_a(0), des_a(3)): 0-6j,\n", " (cre_a(3), des_a(0), cre_b(2)): -1,\n", - " (cre_b(2)): -5\n", + " (cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,\n", + " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,\n", + " (cre_b(2)): -5,\n", + " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,\n", + " (cre_b(1), des_b(5), cre_a(4)): 12-12j,\n", + " (cre_a(3), des_a(0)): 0+3j\n", "})" ] }, @@ -219,10 +219,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.394709Z", - "iopub.status.busy": "2023-10-19T14:42:37.393740Z", - "iopub.status.idle": "2023-10-19T14:42:37.399514Z", - "shell.execute_reply": "2023-10-19T14:42:37.399055Z" + "iopub.execute_input": "2023-10-19T16:30:22.058256Z", + "iopub.status.busy": "2023-10-19T16:30:22.057797Z", + "iopub.status.idle": "2023-10-19T16:30:22.064878Z", + "shell.execute_reply": "2023-10-19T16:30:22.064352Z" } }, "outputs": [ @@ -230,16 +230,16 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_a(3), des_a(0)): 0+3j,\n", - " (cre_b(2)): -5,\n", - " (cre_b(1), cre_a(4), des_b(5), des_b(3), des_a(3)): -1+1j,\n", - " (cre_b(2), cre_b(1), cre_a(4), des_b(5)): 4+4j,\n", - " (cre_a(0), des_a(3)): 0-6j,\n", - " (cre_b(2), cre_a(0), des_a(3)): 2,\n", - " (cre_a(3), des_b(3), des_a(3), des_a(0)): 0+0.25j,\n", " (des_b(3), des_a(3)): 0+1.25j,\n", + " (cre_b(2), cre_a(0), des_a(3)): 2,\n", + " (cre_a(0), des_a(3)): 0-6j,\n", " (cre_b(2), cre_a(3), des_a(0)): -1,\n", - " (cre_b(1), cre_a(4), des_b(5)): -12+12j\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_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), des_b(3), des_a(3)): -1+1j,\n", + " (cre_b(2)): -5\n", "})" ] }, @@ -264,10 +264,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.403183Z", - "iopub.status.busy": "2023-10-19T14:42:37.402262Z", - "iopub.status.idle": "2023-10-19T14:42:37.407487Z", - "shell.execute_reply": "2023-10-19T14:42:37.407040Z" + "iopub.execute_input": "2023-10-19T16:30:22.069240Z", + "iopub.status.busy": "2023-10-19T16:30:22.068020Z", + "iopub.status.idle": "2023-10-19T16:30:22.074090Z", + "shell.execute_reply": "2023-10-19T16:30:22.073516Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.411097Z", - "iopub.status.busy": "2023-10-19T14:42:37.410179Z", - "iopub.status.idle": "2023-10-19T14:42:37.416471Z", - "shell.execute_reply": "2023-10-19T14:42:37.416023Z" + "iopub.execute_input": "2023-10-19T16:30:22.078346Z", + "iopub.status.busy": "2023-10-19T16:30:22.077123Z", + "iopub.status.idle": "2023-10-19T16:30:22.084444Z", + "shell.execute_reply": "2023-10-19T16:30:22.083907Z" } }, "outputs": [ @@ -340,21 +340,21 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.420049Z", - "iopub.status.busy": "2023-10-19T14:42:37.419152Z", - "iopub.status.idle": "2023-10-19T14:42:37.426669Z", - "shell.execute_reply": "2023-10-19T14:42:37.426204Z" + "iopub.execute_input": "2023-10-19T16:30:22.087872Z", + "iopub.status.busy": "2023-10-19T16:30:22.087478Z", + "iopub.status.idle": "2023-10-19T16:30:22.095690Z", + "shell.execute_reply": "2023-10-19T16:30:22.095163Z" } }, "outputs": [ { "data": { "text/plain": [ - "array([0. +0.j , 0. +0.j ,\n", - " 0. +0.j , 0. +0.j ,\n", - " 0.11889056-0.13114645j, 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.14601055-0.2517831j, 0. +0.j ,\n", + " 0. +0.j , 0. +0.j ,\n", + " 0. +0.j ])" ] }, "execution_count": 8, @@ -379,10 +379,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.430250Z", - "iopub.status.busy": "2023-10-19T14:42:37.429345Z", - "iopub.status.idle": "2023-10-19T14:42:37.441262Z", - "shell.execute_reply": "2023-10-19T14:42:37.440811Z" + "iopub.execute_input": "2023-10-19T16:30:22.099160Z", + "iopub.status.busy": "2023-10-19T16:30:22.098684Z", + "iopub.status.idle": "2023-10-19T16:30:22.112817Z", + "shell.execute_reply": "2023-10-19T16:30:22.112282Z" } }, "outputs": [ diff --git a/.doctrees/tutorials/03-double-factorized.doctree b/.doctrees/tutorials/03-double-factorized.doctree index f54f0264c..cce624448 100644 Binary files a/.doctrees/tutorials/03-double-factorized.doctree and b/.doctrees/tutorials/03-double-factorized.doctree differ diff --git a/.doctrees/tutorials/04-lucj.doctree b/.doctrees/tutorials/04-lucj.doctree index 58be5e64f..56f3e427c 100644 Binary files a/.doctrees/tutorials/04-lucj.doctree and b/.doctrees/tutorials/04-lucj.doctree differ diff --git a/.doctrees/tutorials/05-fermion-operator.doctree b/.doctrees/tutorials/05-fermion-operator.doctree index d0a4efb32..538c25b1a 100644 Binary files a/.doctrees/tutorials/05-fermion-operator.doctree and b/.doctrees/tutorials/05-fermion-operator.doctree differ diff --git a/_modules/ffsim/hamiltonians/double_factorized_hamiltonian.html b/_modules/ffsim/hamiltonians/double_factorized_hamiltonian.html index c59fc37e5..c585f5b4d 100644 --- a/_modules/ffsim/hamiltonians/double_factorized_hamiltonian.html +++ b/_modules/ffsim/hamiltonians/double_factorized_hamiltonian.html @@ -161,6 +161,166 @@

Source code for ffsim.hamiltonians.double_factorized_hamiltonian

constant=self.constant - constant_correction, z_representation=False, )
+ + +
+[docs] + @staticmethod + def from_molecular_hamiltonian( + hamiltonian: MolecularHamiltonian, + *, + z_representation: bool = False, + tol: float = 1e-8, + max_vecs: int | None = None, + optimize: bool = False, + method: str = "L-BFGS-B", + options: dict | None = None, + diag_coulomb_mask: np.ndarray | None = None, + cholesky: bool = True, + ) -> DoubleFactorizedHamiltonian: + r"""Double-factorized decomposition of a molecular Hamiltonian. + + The double-factorized decomposition acts on a Hamiltonian of the form + + .. math:: + + H = \sum_{pq, \sigma} h_{pq} a^\dagger_{p, \sigma} a_{q, \sigma} + + \frac12 \sum_{pqrs, \sigma \tau} h_{pqrs} + a^\dagger_{p, \sigma} a^\dagger_{r, \tau} a_{s, \tau} a_{q, \sigma} + + \text{constant}. + + The Hamiltonian is decomposed into the double-factorized form + + .. math:: + + H = \sum_{pq, \sigma} \kappa_{pq} a^\dagger_{p, \sigma} a_{q, \sigma} + + \frac12 \sum_t \sum_{ij, \sigma\tau} + Z^{(t)}_{ij} n^{(t)}_{i, \sigma} n^{(t)}_{j, \tau} + + \text{constant}'. + + where + + .. math:: + + n^{(t)}_{i, \sigma} = \sum_{pq} U^{(t)}_{pi} + a^\dagger_{p, \sigma} a^\dagger_{q, \sigma} U^{(t)}_{qi}. + + Here :math:`U^{(t)}_{ij}` and :math:`Z^{(t)}_{ij}` are tensors that are output + by the decomposition, and :math:`\kappa_{pq}` is an updated one-body tensor. + Each matrix :math:`U^{(t)}` is guaranteed to be unitary so that the + :math:`n^{(t)}_{i, \sigma}` are number operators in a rotated basis, and + each :math:`Z^{(t)}` is a real symmetric matrix. + The number of terms :math:`t` in the decomposition depends on the allowed + error threshold. A larger error threshold leads to a smaller number of terms. + Furthermore, the `max_rank` parameter specifies an optional upper bound + on :math:`t`. + + The default behavior of this routine is to perform a straightforward + "exact" factorization of the two-body tensor based on a nested + eigenvalue decomposition. Additionally, one can choose to optimize the + coefficients stored in the tensor to achieve a "compressed" factorization. + This option is enabled by setting the `optimize` parameter to `True`. + The optimization attempts to minimize a least-squares objective function + quantifying the error in the low rank decomposition. + It uses `scipy.optimize.minimize`, passing both the objective function + and its gradient. The diagonal coulomb matrices returned by the optimization + can be optionally constrained to have only certain elements allowed to be + nonzero. This is achieved by passing the `diag_coulomb_mask` parameter, which is + an :math:`N \times N` matrix of boolean values where :math:`N` is the number + of orbitals. The nonzero elements of this matrix indicate where the diagonal + Coulomb matrices are allowed to be nonzero. Only the upper triangular part of + the matrix is used because the diagonal Coulomb matrices are symmetric. + + **"Z" representation** + + The "Z" representation of the double factorization is an alternative + representation that sometimes yields simpler quantum circuits. + + Under the Jordan-Wigner transformation, the number operators take the form + + .. math:: + + n^{(t)}_{i, \sigma} = \frac{(1 - z^{(t)}_{i, \sigma})}{2} + + where :math:`z^{(t)}_{i, \sigma}` is the Pauli Z operator in the rotated basis. + The "Z" representation is obtained by rewriting the two-body part in terms + of these Pauli Z operators and updating the one-body term as appropriate: + + .. math:: + + H = \sum_{pq, \sigma} \kappa'_{pq} a^\dagger_{p, \sigma} a_{q, \sigma} + + \frac18 \sum_t \sum_{ij, \sigma\tau}^* + Z^{(t)}_{ij} z^{(t)}_{i, \sigma} z^{(t)}_{j, \tau} + + \text{constant}'' + + where the asterisk denotes summation over indices :math:`ij, \sigma\tau` + where :math:`i \neq j` or :math:`\sigma \neq \tau`. + + Note: Currently, only real-valued two-body tensors are supported. + + Args: + one_body_tensor: The one-body tensor of the Hamiltonian. + two_body_tensor: The two-body tensor of the Hamiltonian. + z_representation: Whether to use the "Z" representation of the + low rank decomposition. + tol: Tolerance for error in the decomposition. + The error is defined as the maximum absolute difference between + an element of the original tensor and the corresponding element of + the reconstructed tensor. + max_vecs: An optional limit on the number of terms to keep in the + decomposition of the two-body tensor. This argument overrides ``tol``. + optimize: Whether to optimize the tensors returned by the decomposition. + method: The optimization method. See the documentation of + `scipy.optimize.minimize`_ for possible values. + callback: Callback function for the optimization. See the documentation of + `scipy.optimize.minimize`_ for usage. + options: Options for the optimization. See the documentation of + `scipy.optimize.minimize`_ for usage. + diag_coulomb_mask: Diagonal Coulomb matrix mask to use in the optimization. + This is a matrix of boolean values where the nonzero elements indicate + where the diagonal Coulomb matrices returned by optimization are allowed + to be nonzero. This parameter is only used if `optimize` is set to + True, and only the upper triangular part of the matrix is used. + cholesky: Whether to perform the factorization using a modified Cholesky + decomposition. If False, a full eigenvalue decomposition is used + instead, which can be much more expensive. This argument is ignored if + ``optimize`` is set to True. + + Returns: + The double-factorized Hamiltonian. + + References: + - `arXiv:1808.02625`_ + - `arXiv:2104.08957`_ + + .. _arXiv:1808.02625: https://arxiv.org/abs/1808.02625 + .. _arXiv:2104.08957: https://arxiv.org/abs/2104.08957 + .. _scipy.optimize.minimize: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html + """ + one_body_tensor = hamiltonian.one_body_tensor - 0.5 * np.einsum( + "prqr", hamiltonian.two_body_tensor + ) + + diag_coulomb_mats, orbital_rotations = double_factorized( + hamiltonian.two_body_tensor, + tol=tol, + max_vecs=max_vecs, + optimize=optimize, + method=method, + options=options, + diag_coulomb_mask=diag_coulomb_mask, + cholesky=cholesky, + ) + df_hamiltonian = DoubleFactorizedHamiltonian( + one_body_tensor=one_body_tensor, + diag_coulomb_mats=diag_coulomb_mats, + orbital_rotations=orbital_rotations, + ) + + if z_representation: + df_hamiltonian = df_hamiltonian.to_z_representation() + + return df_hamiltonian
@@ -186,165 +346,6 @@

Source code for ffsim.hamiltonians.double_factorized_hamiltonian

diag_coulomb_mats ) return one_body_correction, constant_correction - - -
-[docs] -def double_factorized_hamiltonian( - hamiltonian: MolecularHamiltonian, - *, - z_representation: bool = False, - tol: float = 1e-8, - max_vecs: int | None = None, - optimize: bool = False, - method: str = "L-BFGS-B", - options: dict | None = None, - diag_coulomb_mask: np.ndarray | None = None, - cholesky: bool = True, -) -> DoubleFactorizedHamiltonian: - r"""Double-factorized decomposition of a molecular Hamiltonian. - - The double-factorized decomposition acts on a Hamiltonian of the form - - .. math:: - - H = \sum_{pq, \sigma} h_{pq} a^\dagger_{p, \sigma} a_{q, \sigma} - + \frac12 \sum_{pqrs, \sigma \tau} h_{pqrs} - a^\dagger_{p, \sigma} a^\dagger_{r, \tau} a_{s, \tau} a_{q, \sigma} - + \text{constant}. - - The Hamiltonian is decomposed into the double-factorized form - - .. math:: - - H = \sum_{pq, \sigma} \kappa_{pq} a^\dagger_{p, \sigma} a_{q, \sigma} - + \frac12 \sum_t \sum_{ij, \sigma\tau} - Z^{(t)}_{ij} n^{(t)}_{i, \sigma} n^{(t)}_{j, \tau} - + \text{constant}'. - - where - - .. math:: - - n^{(t)}_{i, \sigma} = \sum_{pq} U^{(t)}_{pi} - a^\dagger_{p, \sigma} a^\dagger_{q, \sigma} U^{(t)}_{qi}. - - Here :math:`U^{(t)}_{ij}` and :math:`Z^{(t)}_{ij}` are tensors that are output by - the decomposition, and :math:`\kappa_{pq}` is an updated one-body tensor. - Each matrix :math:`U^{(t)}` is guaranteed to be unitary so that the - :math:`n^{(t)}_{i, \sigma}` are number operators in a rotated basis, and - each :math:`Z^{(t)}` is a real symmetric matrix. - The number of terms :math:`t` in the decomposition depends on the allowed - error threshold. A larger error threshold leads to a smaller number of terms. - Furthermore, the `max_rank` parameter specifies an optional upper bound - on :math:`t`. - - The default behavior of this routine is to perform a straightforward - "exact" factorization of the two-body tensor based on a nested - eigenvalue decomposition. Additionally, one can choose to optimize the - coefficients stored in the tensor to achieve a "compressed" factorization. - This option is enabled by setting the `optimize` parameter to `True`. - The optimization attempts to minimize a least-squares objective function - quantifying the error in the low rank decomposition. - It uses `scipy.optimize.minimize`, passing both the objective function - and its gradient. The core tensors returned by the optimization can be optionally - constrained to have only certain elements allowed to be nonzero. This is achieved by - passing the `diag_coulomb_mask` parameter, which is an :math:`N \times N` matrix of - boolean values where :math:`N` is the number of orbitals. The nonzero elements of - this matrix indicate where the core tensors are allowed to be nonzero. Only the - upper triangular part of the matrix is used because the core tensors are symmetric. - - **"Z" representation** - - The "Z" representation of the double factorization is an alternative - representation that sometimes yields simpler quantum circuits. - - Under the Jordan-Wigner transformation, the number operators take the form - - .. math:: - - n^{(t)}_{i, \sigma} = \frac{(1 - z^{(t)}_{i, \sigma})}{2} - - where :math:`z^{(t)}_{i, \sigma}` is the Pauli Z operator in the rotated basis. - The "Z" representation is obtained by rewriting the two-body part in terms - of these Pauli Z operators and updating the one-body term as appropriate: - - .. math:: - - H = \sum_{pq, \sigma} \kappa'_{pq} a^\dagger_{p, \sigma} a_{q, \sigma} - + \frac18 \sum_t \sum_{ij, \sigma\tau}^* - Z^{(t)}_{ij} z^{(t)}_{i, \sigma} z^{(t)}_{j, \tau} - + \text{constant}'' - - where the asterisk denotes summation over indices :math:`ij, \sigma\tau` - where :math:`i \neq j` or :math:`\sigma \neq \tau`. - - Note: Currently, only real-valued two-body tensors are supported. - - Args: - one_body_tensor: The one-body tensor of the Hamiltonian. - two_body_tensor: The two-body tensor of the Hamiltonian. - z_representation: Whether to use the "Z" representation of the - low rank decomposition. - tol: Tolerance for error in the decomposition. - The error is defined as the maximum absolute difference between - an element of the original tensor and the corresponding element of - the reconstructed tensor. - max_vecs: An optional limit on the number of terms to keep in the decomposition - of the two-body tensor. This argument overrides ``tol``. - optimize: Whether to optimize the tensors returned by the decomposition. - method: The optimization method. See the documentation of - `scipy.optimize.minimize`_ for possible values. - callback: Callback function for the optimization. See the documentation of - `scipy.optimize.minimize`_ for usage. - options: Options for the optimization. See the documentation of - `scipy.optimize.minimize`_ for usage. - diag_coulomb_mask: Diagonal Coulomb matrix mask to use in the optimization. - This is a matrix of boolean values where the nonzero elements indicate where - the diagonal coulomb matrices returned by optimization are allowed to be - nonzero. This parameter is only used if `optimize` is set to `True`, and - only the upper triangular part of the matrix is used. - cholesky: Whether to perform the factorization using a modified Cholesky - decomposition. If False, a full eigenvalue decomposition is used instead, - which can be much more expensive. This argument is ignored if ``optimize`` - is set to True. - - Returns: - The double-factorized Hamiltonian. - - References: - - `arXiv:1808.02625`_ - - `arXiv:2104.08957`_ - - .. _arXiv:1808.02625: https://arxiv.org/abs/1808.02625 - .. _arXiv:2104.08957: https://arxiv.org/abs/2104.08957 - .. _scipy.optimize.minimize: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html - """ - one_body_tensor = hamiltonian.one_body_tensor - 0.5 * np.einsum( - "prqr", hamiltonian.two_body_tensor - ) - - diag_coulomb_mats, orbital_rotations = double_factorized( - hamiltonian.two_body_tensor, - tol=tol, - max_vecs=max_vecs, - optimize=optimize, - method=method, - options=options, - diag_coulomb_mask=diag_coulomb_mask, - cholesky=cholesky, - ) - df_hamiltonian = DoubleFactorizedHamiltonian( - one_body_tensor=one_body_tensor, - diag_coulomb_mats=diag_coulomb_mats, - orbital_rotations=orbital_rotations, - ) - - if z_representation: - df_hamiltonian = df_hamiltonian.to_z_representation() - - return df_hamiltonian
-
diff --git a/_sources/tutorials/03-double-factorized.ipynb.txt b/_sources/tutorials/03-double-factorized.ipynb.txt index 935060978..589df6c62 100644 --- a/_sources/tutorials/03-double-factorized.ipynb.txt +++ b/_sources/tutorials/03-double-factorized.ipynb.txt @@ -63,14 +63,16 @@ "mol_hamiltonian = mol_data.hamiltonian\n", "\n", "# Get the Hamiltonian in the double-factorized representation\n", - "df_hamiltonian = ffsim.double_factorized_hamiltonian(mol_hamiltonian)" + "df_hamiltonian = ffsim.DoubleFactorizedHamiltonian.from_molecular_hamiltonian(\n", + " mol_hamiltonian\n", + ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The function `double_factorized_hamiltonian` returns an object of type `DoubleFactorizedHamiltonian` which is just a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations." + "Here, `mol_hamiltonian` is an instance of `MolecularHamiltonian`, a dataclass that stores the one- and two-body tensors, and `df_hamiltonian` is an instance of `DoubleFactorizedHamiltonian`, a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations." ] }, { @@ -404,7 +406,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.10.13" }, "orig_nbformat": 4 }, diff --git a/api/generated/ffsim.hamiltonians.html b/api/generated/ffsim.hamiltonians.html index ad02c7c7f..ff84fc0fe 100644 --- a/api/generated/ffsim.hamiltonians.html +++ b/api/generated/ffsim.hamiltonians.html @@ -110,39 +110,9 @@

Submodules -
-property norb
-

The number of spatial orbitals.

-
- -
-
-to_number_representation()[source]
-

Return the Hamiltonian in the “number” representation.

-
-
Return type:
-

DoubleFactorizedHamiltonian

-
-
-
-
-
-to_z_representation()[source]
-

Return the Hamiltonian in the “Z” representation.

-
-
Return type:
-

DoubleFactorizedHamiltonian

-
-
-
- - - -
-
-ffsim.hamiltonians.double_factorized_hamiltonian.double_factorized_hamiltonian(hamiltonian, *, z_representation=False, tol=1e-08, max_vecs=None, optimize=False, method='L-BFGS-B', options=None, diag_coulomb_mask=None, cholesky=True)[source]
+
+static from_molecular_hamiltonian(hamiltonian, *, z_representation=False, tol=1e-08, max_vecs=None, optimize=False, method='L-BFGS-B', options=None, diag_coulomb_mask=None, cholesky=True)[source]

Double-factorized decomposition of a molecular Hamiltonian.

The double-factorized decomposition acts on a Hamiltonian of the form

-

Here \(U^{(t)}_{ij}\) and \(Z^{(t)}_{ij}\) are tensors that are output by -the decomposition, and \(\kappa_{pq}\) is an updated one-body tensor. +

Here \(U^{(t)}_{ij}\) and \(Z^{(t)}_{ij}\) are tensors that are output +by the decomposition, and \(\kappa_{pq}\) is an updated one-body tensor. Each matrix \(U^{(t)}\) is guaranteed to be unitary so that the \(n^{(t)}_{i, \sigma}\) are number operators in a rotated basis, and each \(Z^{(t)}\) is a real symmetric matrix. @@ -177,12 +147,13 @@

Submodules\(N \times N\) matrix of -boolean values where \(N\) is the number of orbitals. The nonzero elements of -this matrix indicate where the core tensors are allowed to be nonzero. Only the -upper triangular part of the matrix is used because the core tensors are symmetric.

+and its gradient. The diagonal coulomb matrices returned by the optimization +can be optionally constrained to have only certain elements allowed to be +nonzero. This is achieved by passing the diag_coulomb_mask parameter, which is +an \(N \times N\) matrix of boolean values where \(N\) is the number +of orbitals. The nonzero elements of this matrix indicate where the diagonal +Coulomb matrices are allowed to be nonzero. Only the upper triangular part of +the matrix is used because the diagonal Coulomb matrices are symmetric.

“Z” representation

The “Z” representation of the double factorization is an alternative representation that sometimes yields simpler quantum circuits.

@@ -211,8 +182,8 @@

SubmodulesOptional[int]) – An optional limit on the number of terms to keep in the decomposition -of the two-body tensor. This argument overrides tol.

+
  • max_vecs (Optional[int]) – An optional limit on the number of terms to keep in the +decomposition of the two-body tensor. This argument overrides tol.

  • optimize (bool) – Whether to optimize the tensors returned by the decomposition.

  • method (str) – The optimization method. See the documentation of scipy.optimize.minimize for possible values.

  • @@ -221,14 +192,14 @@

    SubmodulesOptional[dict]) – Options for the optimization. See the documentation of scipy.optimize.minimize for usage.

  • diag_coulomb_mask (Optional[ndarray]) – Diagonal Coulomb matrix mask to use in the optimization. -This is a matrix of boolean values where the nonzero elements indicate where -the diagonal coulomb matrices returned by optimization are allowed to be -nonzero. This parameter is only used if optimize is set to True, and -only the upper triangular part of the matrix is used.

  • +This is a matrix of boolean values where the nonzero elements indicate +where the diagonal Coulomb matrices returned by optimization are allowed +to be nonzero. This parameter is only used if optimize is set to +True, and only the upper triangular part of the matrix is used.

  • cholesky (bool) – Whether to perform the factorization using a modified Cholesky -decomposition. If False, a full eigenvalue decomposition is used instead, -which can be much more expensive. This argument is ignored if optimize -is set to True.

  • +decomposition. If False, a full eigenvalue decomposition is used +instead, which can be much more expensive. This argument is ignored if +optimize is set to True.

    Return type:
    @@ -245,6 +216,36 @@

    Submodules +
    +property norb
    +

    The number of spatial orbitals.

    +

    + +
    +
    +to_number_representation()[source]
    +

    Return the Hamiltonian in the “number” representation.

    +
    +
    Return type:
    +

    DoubleFactorizedHamiltonian

    +
    +
    +
    + +
    +
    +to_z_representation()[source]
    +

    Return the Hamiltonian in the “Z” representation.

    +
    +
    Return type:
    +

    DoubleFactorizedHamiltonian

    +
    +
    +
    + + +

    ffsim.hamiltonians.molecular_hamiltonian module

    diff --git a/api/generated/ffsim.html b/api/generated/ffsim.html index e332543e2..e0148a0d6 100644 --- a/api/generated/ffsim.html +++ b/api/generated/ffsim.html @@ -102,12 +102,12 @@

    SubpackagesDoubleFactorizedHamiltonian.orbital_rotations
  • DoubleFactorizedHamiltonian.constant
  • DoubleFactorizedHamiltonian.z_representation
  • +
  • DoubleFactorizedHamiltonian.from_molecular_hamiltonian()
  • DoubleFactorizedHamiltonian.norb
  • DoubleFactorizedHamiltonian.to_number_representation()
  • DoubleFactorizedHamiltonian.to_z_representation()
  • -
  • double_factorized_hamiltonian()
  • ffsim.hamiltonians.molecular_hamiltonian module
  • final_orbital_rotation (ffsim.variational.lucj.UCJOperator attribute) +
  • +
  • from_molecular_hamiltonian() (ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian static method)
  • from_parameters() (ffsim.variational.lucj.UCJOperator static method)
  • diff --git a/objects.inv b/objects.inv index 56ad4d828..fc16251cb 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/searchindex.js b/searchindex.js index 70940076b..ffd6b101b 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["api/generated/ffsim", "api/generated/ffsim.contract", "api/generated/ffsim.gates", "api/generated/ffsim.hamiltonians", "api/generated/ffsim.linalg", "api/generated/ffsim.protocols", "api/generated/ffsim.trotter", "api/generated/ffsim.variational", "api/generated/modules", "api/index", "index", "tutorials/01-introduction", "tutorials/02-orbital-rotation", "tutorials/03-double-factorized", "tutorials/04-lucj", "tutorials/05-fermion-operator", "tutorials/index"], "filenames": ["api/generated/ffsim.rst", "api/generated/ffsim.contract.rst", "api/generated/ffsim.gates.rst", "api/generated/ffsim.hamiltonians.rst", "api/generated/ffsim.linalg.rst", "api/generated/ffsim.protocols.rst", "api/generated/ffsim.trotter.rst", "api/generated/ffsim.variational.rst", "api/generated/modules.rst", "api/index.rst", "index.rst", "tutorials/01-introduction.ipynb", "tutorials/02-orbital-rotation.ipynb", "tutorials/03-double-factorized.ipynb", "tutorials/04-lucj.ipynb", "tutorials/05-fermion-operator.ipynb", "tutorials/index.rst"], "titles": ["ffsim package", "ffsim.contract package", "ffsim.gates package", "ffsim.hamiltonians package", "ffsim.linalg package", "ffsim.protocols package", "ffsim.trotter package", "ffsim.variational package", "ffsim", "API reference", "ffsim documentation", "Introduction to ffsim", "Orbital rotations and quadratic Hamiltonians", "Diagonal Coulomb operators and double-factorized Trotter simulation", "The local unitary cluster Jastrow (LUCJ) ansatz", "The FermionOperator class", "Tutorials"], "terms": {"contract": [0, 8, 9, 12], "diag_coulomb": [0, 8], "contract_diag_coulomb": [0, 1], "diag_coulomb_linop": [0, 1], "hamiltonian": [0, 6, 8, 9, 14, 16], "hamiltonian_linop": [0, 1, 12], "hamiltonian_trac": [0, 1], "num_op_sum": [0, 8], "contract_num_op_sum": [0, 1], "num_op_sum_linop": [0, 1], "gate": [0, 8, 9, 14], "basic_g": [0, 8], "apply_fsim_g": [0, 2], "apply_givens_rot": [0, 2], "apply_hop_g": [0, 2], "apply_num_interact": [0, 2], "apply_num_num_interact": [0, 2], "apply_num_op_prod_interact": [0, 2], "apply_tunneling_interact": [0, 2], "apply_diag_coulomb_evolut": [0, 2, 13], "apply_num_op_sum_evolut": [0, 2, 12, 13], "orbital_rot": [0, 1, 3, 4, 6, 7, 8, 11, 12, 13], "apply_orbital_rot": [0, 2, 11, 12], "gen_orbital_rotation_index": [0, 2], "double_factorized_hamiltonian": [0, 8, 13], "doublefactorizedhamiltonian": [0, 3, 6, 13], "one_body_tensor": [0, 1, 3, 6, 12, 13], "diag_coulomb_mat": [0, 3, 6, 13], "constant": [0, 1, 3, 13, 14], "z_represent": [0, 1, 2, 3, 6], "norb": [0, 1, 2, 3, 5, 6, 7, 11, 12, 13, 14, 15], "to_number_represent": [0, 3], "to_z_represent": [0, 3], "molecular_hamiltonian": [0, 8], "molecularhamiltonian": [0, 3], "two_body_tensor": [0, 1, 3, 4, 13], "linalg": [0, 8, 9, 12, 13, 15], "double_factor": [0, 8], "double_factorized_t2": [0, 4], "modified_choleski": [0, 4], "optimal_diag_coulomb_mat": [0, 4], "given": [0, 1, 2, 6, 8, 12, 13], "apply_matrix_to_slic": [0, 4], "givens_decomposit": [0, 4], "zrotg": [0, 4], "expm_multiply_taylor": [0, 4], "lup": [0, 4], "predic": [0, 8], "is_antihermitian": [0, 4], "is_hermitian": [0, 4], "is_orthogon": [0, 4], "is_real_symmetr": [0, 4], "is_special_orthogon": [0, 4], "is_unitari": [0, 4], "protocol": [0, 8, 9], "approximate_equ": [0, 8], "supportsapproximateequ": [0, 5], "approx_eq": [0, 5], "linear_oper": [0, 8, 13, 14, 15], "supportslinearoper": [0, 5], "trace": [0, 1, 8, 13], "supportstrac": [0, 5], "trotter": [0, 8, 9, 16], "qdrift": [0, 8], "expectation_squared_diag_coulomb": [0, 6], "one_body_square_decomposit": [0, 6], "qdrift_prob": [0, 6], "simulate_qdrift_double_factor": [0, 6], "spectral_norm_diag_coulomb": [0, 6], "spectral_norm_one_body_tensor": [0, 6], "variance_diag_coulomb": [0, 6], "variance_one_body_tensor": [0, 6], "simulate_trotter_double_factor": [0, 6, 13], "variat": [0, 8, 9, 14], "lucj": [0, 8, 16], "ucjoper": [0, 7, 14], "diag_coulomb_mats_alpha_alpha": [0, 7], "diag_coulomb_mats_alpha_beta": [0, 7], "final_orbital_rot": [0, 7], "from_paramet": [0, 7, 14], "from_t_amplitud": [0, 7, 14], "n_rep": [0, 7, 14], "to_paramet": [0, 7, 14], "to_t_amplitud": [0, 7], "apply_ucj_oper": [0, 7, 14], "The": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 16], "fermionact": [0, 8, 9], "namedtupl": 0, "construct": [0, 1, 13, 14, 15], "function": [0, 1, 2, 3, 4, 6, 7, 11, 12, 13, 14, 15], "class": [0, 3, 5, 7, 11, 14, 16], "action": [0, 1, 8, 12, 15], "bool": [0, 1, 2, 3, 4, 5, 6, 7], "spin": [0, 1, 2, 7, 8, 11, 12, 14, 15], "orb": [0, 8, 15], "int": [0, 1, 2, 3, 4, 5, 6, 7, 13], "sourc": [0, 1, 2, 3, 4, 5, 6, 7], "base": [0, 3, 4, 5, 7, 14], "A": [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15], "fermion": [0, 2, 10, 11, 12, 14, 15], "creat": [0, 2, 11, 12, 13, 14, 15], "new": [0, 12, 15], "instanc": [0, 12], "alia": 0, "field": 0, "number": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15], "0": [0, 1, 2, 3, 6, 12, 13, 14, 15], "2": [0, 1, 2, 3, 4, 11, 12, 13, 14, 15], "1": [0, 2, 3, 4, 6, 7, 11, 12, 13, 14, 15], "cre": [0, 8, 9], "paramet": [0, 1, 2, 3, 4, 5, 6, 7, 14], "orbit": [0, 1, 2, 3, 4, 5, 6, 7, 11, 13, 14, 15, 16], "fals": [0, 1, 2, 3, 4, 5, 6, 7, 15], "alpha": [0, 1, 2, 5, 6, 7, 11, 14, 15], "true": [0, 2, 3, 4, 5, 6, 7, 11, 14, 15], "beta": [0, 1, 2, 5, 6, 7, 11, 14, 15], "index": [0, 2, 10, 11, 14, 15], "act": [0, 3, 15], "return": [0, 1, 2, 3, 4, 5, 6, 7, 13, 14, 15], "type": [0, 1, 2, 3, 4, 5, 6, 7, 13], "cre_a": [0, 8, 9, 15], "cre_b": [0, 8, 9, 15], "de": [0, 8, 9], "destroi": [0, 15], "des_a": [0, 8, 9, 15], "des_b": [0, 8, 9, 15], "moleculardata": [0, 8, 9, 13, 14], "nelec": [0, 1, 2, 5, 6, 7, 11, 12, 13, 14, 15], "core_energi": 0, "dipole_integr": 0, "none": [0, 1, 2, 3, 4, 6, 7], "orbital_symmetri": 0, "object": [0, 3, 4, 5, 7, 13, 14, 15], "random_antihermitian": [0, 8, 9], "dim": [0, 6, 8, 9, 11, 15], "seed": [0, 6, 11, 12], "dtype": [0, 14], "complex": [0, 4], "anti": [0, 4], "hermitian": [0, 4, 12], "matrix": [0, 1, 2, 3, 4, 6, 11, 12, 13, 14, 15], "width": 0, "height": 0, "rank": [0, 3, 4], "If": [0, 1, 2, 3, 4, 6, 7, 15], "maximum": [0, 3, 4], "i": [0, 1, 2, 3, 4, 6, 7, 11, 12, 13, 14, 15], "us": [0, 1, 2, 3, 4, 6, 11, 12, 13, 14, 15], "initi": [0, 6, 7, 13, 14], "pseudorandom": [0, 6], "gener": [0, 2, 6, 11, 12, 13, 14], "should": [0, 6, 12, 13], "valid": [0, 6], "input": [0, 1, 6, 14], "np": [0, 2, 5, 6, 12, 13, 14], "default_rng": [0, 6], "dype": 0, "data": [0, 2, 6, 7, 13, 14, 15], "result": [0, 1, 4, 7, 12, 13, 14], "ndarrai": [0, 1, 2, 3, 4, 6, 7, 13], "sampl": [0, 6], "random_hermitian": [0, 8, 9, 12], "random_orthogon": [0, 8, 9], "float": [0, 1, 2, 3, 4, 5, 6, 13], "orthogon": [0, 4], "distribut": 0, "haar": 0, "measur": 0, "an": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15], "els": [0, 6], "refer": [0, 3, 4, 10, 14], "arxiv": [0, 3, 4], "math": 0, "ph": 0, "0609050": 0, "random_real_symmetric_matrix": [0, 8, 9], "real": [0, 1, 2, 3, 4, 7, 12, 13, 14], "symmetr": [0, 1, 2, 3, 4, 6, 13, 14], "option": [0, 1, 2, 3, 4, 6, 7, 14], "random_special_orthogon": [0, 8, 9], "special": [0, 4, 11], "random_statevector": [0, 8, 9, 15], "vector": [0, 1, 2, 4, 6, 7, 11, 12, 14, 15], "from": [0, 7, 11, 12, 14, 15], "uniform": [0, 6], "dimens": [0, 6, 11], "random_t2_amplitud": [0, 8, 9], "nocc": [0, 2, 7], "t2": [0, 4, 7, 14], "amplitud": [0, 4, 7, 14], "tensor": [0, 1, 3, 4, 6, 13, 14], "ar": [0, 1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15], "occupi": [0, 1, 2, 13], "electron": [0, 1, 2, 5, 6, 7, 11, 13], "random_two_body_tensor_r": [0, 8, 9], "two": [0, 1, 2, 3, 4, 5, 6, 7, 13, 14], "bodi": [0, 1, 3, 4, 6, 13, 14], "valu": [0, 3, 4, 6, 7, 13, 14], "shape": [0, 4, 6, 11, 14], "default": [0, 3, 4], "behavior": [0, 3, 4], "which": [0, 2, 3, 4, 11, 12, 13, 14, 15], "random_unitari": [0, 8, 9, 11, 12], "unitari": [0, 1, 2, 3, 4, 7, 12, 13, 16], "get": [0, 1, 12, 13, 14], "fci": [0, 1, 11, 14], "space": [0, 14], "spatial": [0, 1, 2, 3, 5, 7, 11, 13, 14, 15], "tupl": [0, 1, 2, 4, 5, 6, 7, 13, 15], "pair": [0, 2], "integ": [0, 2], "dim_a": [0, 11], "dim_b": [0, 11], "repres": [0, 3, 5, 6, 11, 14, 15], "one_hot": [0, 8, 9], "arrai": [0, 2, 4, 6, 11, 15], "all": [0, 2, 14, 15], "zero": [0, 4], "except": 0, "one": [0, 1, 2, 3, 4, 6, 11, 13, 14], "specifi": [0, 2, 3, 4, 5, 6, 14], "desir": 0, "place": [0, 1, 2, 6, 7, 14, 15], "hot": 0, "slater_determin": [0, 8, 9, 11, 12, 13, 14], "occupied_orbit": [0, 11, 12, 13, 14], "slater": [0, 6, 11, 12, 13], "determin": [0, 4, 6, 11, 12, 13], "sequenc": [0, 2], "list": [0, 1, 2, 4, 6, 14], "first": [0, 2, 4, 5, 6, 12, 13, 14], "second": [0, 2, 4, 13], "rotat": [0, 1, 2, 3, 4, 6, 7, 11, 13, 14, 16], "appli": [0, 1, 2, 4, 7, 11, 12, 13, 14], "configur": [0, 11], "In": [0, 7, 12, 13, 14, 15], "other": [0, 5, 14], "word": [0, 14], "thi": [0, 2, 3, 4, 6, 7, 11, 12, 13, 14], "describ": [0, 1, 2, 7, 11, 12, 13, 14, 15], "slater_determinant_one_rdm": [0, 8, 9], "particl": [0, 6, 11, 12, 15], "reduc": [0, 6], "densiti": [0, 6], "contain": [0, 2, 4, 7, 14, 15], "indic": [0, 3, 4, 14, 15], "similarli": [0, 13], "util": [0, 4], "random_nelec": [0, 8, 9], "n_alpha": [0, 11, 12, 13, 14], "n_beta": [0, 11, 12, 13, 14], "random_occupied_orbit": [0, 8, 9], "occ_a": 0, "occ_b": 0, "expectation_pow": [0, 8, 9], "one_rdm": [0, 6], "power": 0, "expect": [0, 6, 12], "oper": [0, 1, 2, 3, 5, 6, 7, 12, 14, 15, 16], "w": [0, 12, 13], "r": [0, 1, 3, 4, 13], "t": [0, 2, 3, 4, 12, 13], "o": 0, "ha": [0, 1, 2, 4, 7, 11, 12, 13, 14], "form": [0, 1, 2, 3, 4, 7, 12, 13, 14, 15], "sum_": [0, 1, 2, 3, 4, 7, 12, 13, 14], "pq": [0, 1, 3, 4, 13], "m_": 0, "a_p": 0, "dagger": [0, 1, 2, 4, 7, 12, 13, 14, 15], "a_q": 0, "take": [0, 3, 11, 14], "m": [0, 4, 12], "its": [0, 2, 3, 4, 6, 7, 12, 13, 15], "argument": [0, 3, 4, 6, 12], "let": [0, 13, 15], "lvert": [0, 14], "psi": [0, 14], "rangl": [0, 14], "Then": 0, "quantiti": 0, "langl": 0, "rvert": 0, "k": [0, 4, 7, 12, 13, 14, 15], "expectation_product": [0, 8, 9], "product": [0, 2, 13, 15], "matric": [0, 1, 3, 4, 7, 12, 13, 14], "o_1": 0, "o_2": 0, "dot": 0, "o_k": 0, "softwar": [0, 11], "librari": [0, 11], "fast": 0, "simul": [0, 6, 10, 11, 12, 14, 16], "quantum": [0, 2, 3, 10, 11, 13, 14], "circuit": [0, 3, 10, 11], "diagon": [1, 2, 3, 4, 6, 7, 12, 14, 16], "coulomb": [1, 2, 3, 4, 6, 7, 14, 16], "vec": [1, 2, 4, 6, 7, 11, 12, 13, 15], "mat": [1, 2, 4], "mat_alpha_beta": [1, 2], "occupations_a": [1, 2], "occupations_b": [1, 2], "strings_a": [1, 2], "strings_b": [1, 2], "j": [1, 2, 3, 7, 12, 13, 14, 15], "sigma": [1, 2, 3, 7, 12, 13, 14], "tau": [1, 2, 3, 7, 13, 14], "z_": [1, 2], "ij": [1, 2, 3, 7, 12, 13, 14], "n_": [1, 2, 7, 11, 12, 13, 14], "where": [1, 2, 3, 4, 6, 7, 12, 13, 14], "denot": [1, 2, 3, 12], "z": [1, 2, 3, 4, 6, 11, 15], "also": [1, 2, 6, 7, 12, 15], "term": [1, 2, 3, 4, 6, 7, 13, 14, 15], "sum": [1, 2, 6, 13], "differ": [1, 2, 3, 4, 7, 14], "neq": [1, 2, 3], "state": [1, 2, 6, 7, 8, 9, 12, 13, 14], "transform": [1, 2, 3, 7, 11, 12], "coeffici": [1, 2, 3, 4, 7, 12, 14, 15], "interact": [1, 2, 11], "between": [1, 2, 3, 4, 14], "whether": [1, 2, 3, 4, 5, 6, 7, 15], "represent": [1, 3, 4, 6, 11, 15], "string": [1, 2, 6, 11, 15], "convert": [1, 5, 7, 11, 12, 13, 15], "linear": [1, 2, 4, 5, 12, 15], "mathcal": [1, 2, 7, 12, 13, 14], "u": [1, 2, 3, 4], "linearoper": [1, 5, 12, 13, 15], "implement": [1, 4, 11, 12, 14], "molecular": [1, 3, 14], "h": [1, 3, 13, 14], "h_": [1, 3, 4, 13], "dagger_": [1, 2, 3, 12, 13], "p": [1, 2, 3, 4, 13, 14], "a_": [1, 2, 3, 12, 13, 15], "q": [1, 3, 13], "frac12": [1, 3, 7, 13, 14], "pqr": [1, 3, 4, 13], "": [1, 3, 4, 9, 11, 13, 14, 15], "here": [1, 3, 4, 11, 12, 13], "call": [1, 3, 11, 12, 13, 15], "basi": [1, 3, 7, 12, 13, 14], "combin": [1, 2, 12, 15], "coeff": [1, 2], "lambda_i": [1, 2, 12], "basic": [2, 13], "comput": [2, 4, 5, 6, 12, 14], "theta": 2, "phi": 2, "target_orb": 2, "copi": [2, 6, 7, 15], "fsim": 2, "consist": 2, "tunnel": 2, "follow": [2, 6, 11, 12, 13, 14, 15], "note": [2, 3, 4, 14, 15], "neg": 2, "sign": 2, "convent": 2, "angl": 2, "text": [2, 3, 13], "nn": 2, "exp": [2, 12], "left": [2, 6, 7, 12, 15], "dagger_i": 2, "a_i": 2, "dagger_j": 2, "a_j": 2, "right": [2, 12, 15], "under": [2, 3], "jordan": [2, 3], "wigner": [2, 3], "when": [2, 13, 14, 15], "neighbor": 2, "qubit": [2, 14], "begin": [2, 12, 14], "pmatrix": 2, "co": 2, "sin": 2, "e": [2, 6, 7, 13, 14, 15], "end": [2, 7, 12, 14], "befor": [2, 6, 7, 14, 15], "alwai": [2, 4, 6, 7, 12], "newli": [2, 6, 7], "alloc": [2, 6, 7], "origin": [2, 3, 4, 6, 7, 13], "untouch": [2, 6, 7], "mai": [2, 4, 6, 7, 14], "still": [2, 6, 7, 14], "have": [2, 3, 4, 6, 7, 11, 12, 14, 15], "overwritten": [2, 6, 7], "It": [2, 3, 4, 6, 7, 11, 13, 15], "possibl": [2, 3, 4, 6, 7], "modifi": [2, 3, 4, 6, 7], "g": [2, 6, 14], "hop": 2, "pi": [2, 3], "n": [2, 3, 4, 11, 12, 13, 14], "prod": 2, "give": [2, 12], "time": [2, 3, 4, 6, 11, 13], "evolut": [2, 6, 13], "orbital_rotation_index_a": 2, "orbital_rotation_index_b": 2, "evolv": [2, 6, 13], "rais": 2, "valueerror": 2, "must": [2, 4, 15], "dimension": [2, 4, 6, 11], "length": [2, 11, 13, 14], "allow_row_permut": 2, "allow_col_permut": 2, "map": [2, 12, 15], "creation": [2, 12, 15], "mapsto": [2, 12], "u_": 2, "ji": [2, 12], "equival": 2, "log": 2, "_": [2, 3, 4, 7, 12, 13, 14], "allow": [2, 3, 4, 14], "permut": [2, 4], "row": [2, 11], "column": [2, 4, 11, 12], "wa": 2, "well": 2, "actual": [2, 12, 14], "effect": 2, "both": [2, 3, 4], "set": [2, 3, 4, 7, 11, 12, 13, 14], "onli": [2, 3, 4, 11, 12, 14], "linkstr_index": 2, "perform": [2, 3, 4, 7, 12, 13], "diag_str": 2, "off_diag_str": 2, "off_diag_index": 2, "three": [2, 15], "numpi": [2, 4, 6, 11, 12, 13, 14], "x": [2, 14], "binom": 2, "th": [2, 12], "unoccupi": 2, "3": [2, 11, 12, 13, 14, 15], "ax": 2, "correspond": [2, 3, 4, 6, 12, 13], "For": [2, 11, 12, 14, 15], "fix": [2, 4, 11], "choic": [2, 11], "str0": 2, "last": 2, "each": [2, 3, 4, 6, 7, 11, 13, 14, 15], "str1": 2, "annihil": [2, 15], "pariti": 2, "doubl": [3, 4, 6, 14, 16], "factor": [3, 4, 6, 14, 16], "low": [3, 4, 11], "decomposit": [3, 4, 6], "kappa_": 3, "sum_t": 3, "qi": 3, "altern": [3, 13], "sometim": 3, "yield": [3, 4, 13, 14], "simpler": 3, "frac": 3, "pauli": 3, "obtain": [3, 12, 13, 14], "rewrit": 3, "part": [3, 4], "updat": [3, 13], "appropri": 3, "kappa": 3, "frac18": 3, "asterisk": 3, "summat": 3, "over": 3, "rather": [3, 4, 11], "than": [3, 4, 6, 11, 14], "properti": [3, 7, 12], "tol": [3, 4, 7], "1e": [3, 4, 5, 6, 7], "08": [3, 4, 5, 7], "max_vec": [3, 4], "optim": [3, 4, 6, 7, 14], "method": [3, 4, 6, 14], "l": [3, 4, 7, 13, 14], "bfg": [3, 4, 14], "b": [3, 4, 12, 14], "diag_coulomb_mask": [3, 4], "choleski": [3, 4], "decompos": [3, 4, 6, 13], "output": [3, 13, 14], "guarante": 3, "so": [3, 4, 12, 13, 14, 15], "depend": [3, 4, 6, 11], "error": [3, 4], "threshold": [3, 4], "larger": [3, 4, 15], "lead": 3, "smaller": [3, 4, 13, 15], "furthermor": [3, 4], "max_rank": 3, "upper": [3, 4, 6, 14], "bound": [3, 4, 6], "routin": [3, 4, 11, 15], "straightforward": [3, 4], "exact": [3, 4, 11, 13], "nest": [3, 4], "eigenvalu": [3, 4, 6, 12], "addition": [3, 4], "can": [3, 4, 5, 7, 11, 12, 13, 14, 15], "choos": [3, 4, 11, 14], "store": [3, 4, 6, 13, 14], "achiev": [3, 4, 13], "compress": [3, 4], "enabl": [3, 4], "attempt": [3, 4], "minim": [3, 4, 14], "least": [3, 4], "squar": [3, 4, 6, 14], "quantifi": [3, 4], "scipi": [3, 4, 5, 11, 12, 13, 14, 15], "pass": [3, 4, 12, 15], "gradient": [3, 4], "core": [3, 4], "constrain": [3, 4], "certain": [3, 4], "element": [3, 4], "nonzero": [3, 4, 14], "boolean": [3, 4], "triangular": [3, 4], "becaus": [3, 4, 11, 13, 14, 15], "current": 3, "support": [3, 6, 7, 15], "toler": [3, 4, 5, 14], "defin": [3, 4, 14], "absolut": [3, 4, 5, 6], "reconstruct": [3, 4], "limit": [3, 4, 14], "keep": [3, 4], "overrid": [3, 4], "str": [3, 4, 6], "see": [3, 4, 5], "document": [3, 4, 5], "callback": [3, 4], "usag": [3, 4, 15], "dict": [3, 4, 14], "mask": [3, 4], "full": [3, 4, 11], "instead": [3, 4], "much": [3, 4, 11], "more": [3, 4, 11, 14], "expens": [3, 4], "ignor": [3, 4, 13], "1808": [3, 4], "02625": [3, 4], "2104": [3, 4], "08957": [3, 4], "ell": 4, "pk": 4, "qk": 4, "respect": 4, "too": 4, "small": 4, "exce": 4, "collect": 4, "t2_amplitud": [4, 7], "t_": 4, "ijab": 4, "ap": 4, "ip": 4, "bq": 4, "jq": 4, "v_i": 4, "posit": 4, "definit": 4, "No": 4, "check": [4, 12, 13], "verifi": 4, "1711": 4, "02242": 4, "includ": [4, 7, 11, 12, 13], "assembl": 4, "whose": [4, 5, 11], "target": 4, "slice": 4, "out": [4, 13], "12": [4, 6, 15], "safe": 4, "version": 4, "bla": 4, "nan": 4, "either": [4, 14], "veri": 4, "close": 4, "detect": 4, "up": [4, 5, 12], "case": 4, "behav": 4, "were": 4, "exactli": 4, "contrast": 4, "c": [4, 14], "algebra": [4, 15], "expm": 4, "taylor": 4, "seri": 4, "expans": 4, "pivot": 4, "lu": 4, "rtype": 4, "lower": 4, "unit": 4, "rtol": [4, 5], "05": [4, 5, 14], "atol": [4, 5], "approxim": [4, 5, 13], "rel": [4, 5], "numer": [4, 5, 15], "within": [4, 15], "union": 4, "bool_": 4, "equal": 5, "arg": 5, "kwarg": 5, "compar": [5, 13], "obj": 5, "isclos": 5, "interpret": 5, "ani": [5, 12, 14], "otherwis": [5, 6], "diag": 6, "op": [6, 15], "truncation_threshold": 6, "less": [6, 14], "truncat": [6, 14], "sampling_method": 6, "probabl": 6, "rest": [6, 13], "same": [6, 7, 11, 14], "order": [6, 7, 11, 13, 14, 15], "thei": [6, 12, 14, 15], "norm": 6, "proport": [6, 12], "spectral": 6, "requir": [6, 14], "incoher": 6, "channel": 6, "n_particl": 6, "total": [6, 7, 13, 14], "n_step": [6, 13], "n_sampl": 6, "via": [6, 13], "step": [6, 12, 13], "explicit": 6, "whenev": 6, "complet": 6, "character": 6, "trajectori": 6, "random": [6, 8, 9, 11, 12, 15], "final": [6, 7, 13, 14], "just": [6, 13, 14], "statevector": [6, 11, 12], "largest": 6, "singular": 6, "varianc": 6, "rdm": 6, "suzuki": 6, "formula": 6, "local": [7, 16], "cluster": [7, 16], "jastrow": [7, 16], "ansatz": [7, 16], "ucj": 7, "prod_": [7, 14], "w_k": [7, 14], "_k": [7, 13, 14], "mathbf": [7, 12, 13, 14], "commut": [7, 13, 14], "we": [7, 12, 13, 14, 15], "enforc": [7, 14], "As": [7, 11, 12, 13, 14], "involv": [7, 14], "To": [7, 11, 12, 13, 14], "static": 7, "param": 7, "alpha_alpha_indic": [7, 14], "alpha_beta_indic": [7, 14], "with_final_orbital_rot": 7, "t1_amplitud": 7, "t1": [7, 14], "repetit": [7, 14], "possibli": 7, "packag": [8, 9], "subpackag": [8, 9], "submodul": [8, 9], "modul": [8, 9, 10, 11], "content": [8, 9], "fermion_act": [8, 9], "molecular_data": [8, 9], "test": [8, 9, 12, 13], "wick": [8, 9], "ffsim": [9, 12, 13, 14, 15, 16], "faster": 10, "tutori": [10, 12, 13, 14], "api": 10, "search": 10, "page": 10, "conserv": [11, 15], "compon": [11, 15], "By": 11, "advantag": 11, "symmetri": [11, 12], "effici": [11, 15], "level": [11, 13], "doe": [11, 15], "primari": 11, "wai": [11, 12, 14], "directli": [11, 13], "exampl": [11, 12, 14, 15], "code": [11, 13, 14, 15], "show": [11, 12, 13, 14, 15], "how": [11, 12, 13, 14, 15], "import": [11, 12, 13, 14, 15], "occup": [11, 12, 13], "6": [11, 12, 13, 14, 15], "rang": [11, 12, 13, 14], "1234": [11, 12], "rotated_vec": [11, 12], "plain": 11, "Its": 11, "system": [11, 12], "conveni": 11, "calcul": [11, 13, 14], "comb": 11, "assert": 11, "standard": 11, "often": [11, 14], "simpli": [11, 12], "reshap": 11, "reshaped_vec": 11, "pyscf": [11, 13, 14], "fundament": 12, "mode": 12, "sum_j": 12, "That": [12, 15], "satisfi": [12, 15], "anticommut": 12, "relat": [12, 14], "align": [12, 14], "_1": 12, "_2": 12, "section": 12, "ll": [12, 13, 14], "demonstr": [12, 13, 14], "task": 12, "consid": [12, 14], "rewritten": 12, "introduc": [12, 14], "eigendecomposit": 12, "sum_k": [12, 13], "lambda_k": 12, "ik": 12, "jk": 12, "our": [12, 13, 14], "ground": [12, 14], "pick": 12, "phase": 12, "energi": [12, 13, 14], "spars": [12, 13, 15], "lowest": [12, 13], "eigenvector": 12, "eig": [12, 15], "eigsh": 12, "la": 12, "fact": 12, "you": 12, "illustr": 12, "purpos": 12, "explicitli": 12, "eigh": [12, 13], "evolved_vec": 12, "conj": 12, "undo": 12, "expected_phas": 12, "1j": [12, 13, 15], "assert_allclos": 12, "mention": [12, 13], "abov": [12, 13, 15], "below": [12, 13, 14], "better": [12, 13], "4": [12, 13, 14, 15], "evolved_vec_alt": 12, "daunt": 13, "scale": 13, "cell": [13, 14], "hydrogen": 13, "molecul": [13, 14], "stretch": [13, 14], "bond": [13, 14], "build": [13, 14], "h2": 13, "mol": [13, 14], "gto": [13, 14], "mole": [13, 14], "atom": [13, 14], "8": [13, 14, 15], "sto": [13, 14], "6g": [13, 14], "hartree_fock": [13, 14], "scf": [13, 14], "rhf": [13, 14], "kernel": [13, 14], "mol_data": [13, 14], "from_hartree_fock": [13, 14], "mol_hamiltonian": [13, 14], "df_hamiltonian": 13, "converg": [13, 14], "837796382593709": 13, "dataclass": [13, 14], "print": [13, 14, 15], "some": [13, 15], "inform": [13, 15], "One": 13, "27478830e": 13, "01": [13, 14], "66405155e": 13, "16": 13, "07220771e": 13, "77238770e": 13, "5": [13, 14, 15], "23173938e": 13, "94289029e": 13, "33545754e": 13, "48240570e": 13, "32667268e": 13, "17": 13, "11022302e": 13, "53132024e": 13, "21318608e": 13, "00": [13, 14], "05183033e": 13, "59876437e": 13, "07792507e": 13, "14653029e": 13, "001": 13, "96958401e": 13, "121": 13, "7": [13, 15], "13206008e": 13, "062": 13, "52090881e": 13, "003": 13, "00000000e": 13, "25128053e": 13, "15": 13, "07106781e": 13, "89310728e": 13, "30": 13, "although": 13, "alreadi": 13, "built": 13, "manual": 13, "asymmetr": 13, "h_k": 13, "divid": 13, "singl": 13, "exponenti": 13, "individu": [13, 15], "do": [13, 15], "approx": 13, "prod_k": 13, "higher": 13, "deriv": 13, "write": 13, "recal": 13, "addit": [13, 15], "think": 13, "compos": 13, "quadrat": [13, 16], "def": [13, 14], "simulate_trotter_step_double_factor": 13, "one_body_energi": 13, "one_body_basis_chang": 13, "zip": 13, "finish": 13, "handl": 13, "split": 13, "multipl": [13, 15], "wrote": 13, "step_tim": 13, "hartre": [13, 14], "fock": [13, 14], "match": 13, "initial_st": 13, "\u03c8": [13, 14], "hf_energi": 13, "vdot": [13, 14], "f": [13, 14], "now": 13, "later": 13, "exact_st": 13, "expm_multipli": 13, "tracea": 13, "fidel": 13, "ab": 13, "9696296369955066": 13, "final_st": [13, 14], "9990275744083491": 13, "improv": 13, "increas": 13, "10": 13, "9999906233109653": 13, "commonli": 13, "known": 13, "fourth": 13, "reproduc": 13, "9": [13, 15], "fewer": 13, "9999999336740059": 13, "ethen": 14, "mcscf": 14, "bond_dist": 14, "678": 14, "5626": 14, "9289": 14, "activ": 14, "active_spac": 14, "nelectron": 14, "ca": 14, "casci": 14, "nca": 14, "neleca": 14, "mo": 14, "sort_mo": 14, "energy_fci": 14, "77": 14, "4456267643961": 14, "6290254326717": 14, "ci": 14, "57322412553863": 14, "0000000": 14, "phi_0": 14, "taken": 14, "express": 14, "previou": 14, "constructor": 14, "provid": 14, "ccsd": 14, "mp2": 14, "run": 14, "cc": 14, "frozen": 14, "mo_coeff": 14, "reference_st": 14, "ansatz_st": 14, "initiali": 14, "49387212754462": 14, "e_corr": 14, "04824536314851573": 14, "46975600021692": 14, "facilit": 14, "convers": 14, "precis": 14, "somewhat": 14, "complic": 14, "short": 14, "entri": 14, "non": 14, "redund": 14, "associ": [14, 15], "fun": 14, "x0": 14, "maxfun": 14, "50000": 14, "len": 14, "72": 14, "messag": 14, "rel_reduction_of_f_": 14, "lt": 14, "_factr": 14, "epsmch": 14, "success": 14, "statu": 14, "62873343946598": 14, "541e": 14, "978e": 14, "02": 14, "239e": 14, "438e": 14, "nit": 14, "329": 14, "jac": 14, "537e": 14, "098e": 14, "04": 14, "956e": 14, "734e": 14, "nfev": 14, "25696": 14, "njev": 14, "352": 14, "hess_inv": 14, "72x72": 14, "lbfgsinvhessproduct": 14, "float64": 14, "gt": 14, "connect": 14, "swap": 14, "network": 14, "make": 14, "challeng": 14, "noisi": 14, "pre": 14, "fault": 14, "processor": 14, "idea": 14, "impos": 14, "sparsiti": 14, "constraint": 14, "them": 14, "depth": 14, "topologi": 14, "triangl": 14, "sinc": 14, "need": 14, "lattic": 14, "parallel": 14, "line": 14, "rung": 14, "ladder": 14, "With": 14, "setup": 14, "while": 14, "share": 14, "ldot": 14, "without": 14, "Of": 14, "cours": 14, "notic": 14, "decreas": 14, "46": 14, "62881470757267": 14, "795e": 14, "386e": 14, "020e": 14, "230e": 14, "585": 14, "434e": 14, "933e": 14, "007e": 14, "450e": 14, "29422": 14, "626": 14, "46x46": 14, "25": 15, "Such": 15, "programmat": 15, "dictionari": 15, "hash": 15, "tabl": 15, "piec": 15, "being": 15, "upon": 15, "intern": 15, "itself": 15, "recommend": 15, "helper": 15, "shown": 15, "op1": 15, "repr": 15, "view": 15, "displai": 15, "39": 15, "0j": 15, "arithmet": 15, "multipli": 15, "scalar": 15, "go": 15, "op2": 15, "op3": 15, "0625": 15, "125": 15, "25j": 15, "5j": 15, "2j": 15, "good": 15, "awar": 15, "especi": 15, "avoid": 15, "These": 15, "subtract": 15, "divis": 15, "3j": 15, "4j": 15, "6j": 15, "12j": 15, "normal": 15, "normal_ord": 15, "compris": 15, "appear": 15, "descend": 15, "lexicograph": 15, "preserv": 15, "far": 15, "criteria": 15, "conserves_particle_numb": 15, "conserves_spin_z": 15, "subspac": 15, "op4": 15, "linop": 15, "onto": 15, "11889056": 15, "13114645j": 15, "most": 15, "lm": 15, "21984743e": 15, "18j": 15, "introduct": 16, "fermionoper": 16}, "objects": {"": [[0, 0, 0, "-", "ffsim"]], "ffsim": [[1, 0, 0, "-", "contract"], [0, 0, 0, "-", "fermion_action"], [2, 0, 0, "-", "gates"], [3, 0, 0, "-", "hamiltonians"], [4, 0, 0, "-", "linalg"], [0, 0, 0, "-", "molecular_data"], [5, 0, 0, "-", "protocols"], [0, 0, 0, "-", "random"], [0, 0, 0, "-", "states"], [0, 0, 0, "-", "testing"], [6, 0, 0, "-", "trotter"], [7, 0, 0, "-", "variational"], [0, 0, 0, "-", "wick"]], "ffsim.contract": [[1, 0, 0, "-", "diag_coulomb"], [1, 0, 0, "-", "hamiltonian"], [1, 0, 0, "-", "num_op_sum"]], "ffsim.contract.diag_coulomb": [[1, 1, 1, "", "contract_diag_coulomb"], [1, 1, 1, "", "diag_coulomb_linop"]], "ffsim.contract.hamiltonian": [[1, 1, 1, "", "hamiltonian_linop"], [1, 1, 1, "", "hamiltonian_trace"]], "ffsim.contract.num_op_sum": [[1, 1, 1, "", "contract_num_op_sum"], [1, 1, 1, "", "num_op_sum_linop"]], "ffsim.fermion_action": [[0, 2, 1, "", "FermionAction"], [0, 1, 1, "", "cre"], [0, 1, 1, "", "cre_a"], [0, 1, 1, "", "cre_b"], [0, 1, 1, "", "des"], [0, 1, 1, "", "des_a"], [0, 1, 1, "", "des_b"]], "ffsim.fermion_action.FermionAction": [[0, 3, 1, "", "action"], [0, 3, 1, "", "orb"], [0, 3, 1, "", "spin"]], "ffsim.gates": [[2, 0, 0, "-", "basic_gates"], [2, 0, 0, "-", "diag_coulomb"], [2, 0, 0, "-", "num_op_sum"], [2, 0, 0, "-", "orbital_rotation"]], "ffsim.gates.basic_gates": [[2, 1, 1, "", "apply_fsim_gate"], [2, 1, 1, "", "apply_givens_rotation"], [2, 1, 1, "", "apply_hop_gate"], [2, 1, 1, "", "apply_num_interaction"], [2, 1, 1, "", "apply_num_num_interaction"], [2, 1, 1, "", "apply_num_op_prod_interaction"], [2, 1, 1, "", "apply_tunneling_interaction"]], "ffsim.gates.diag_coulomb": [[2, 1, 1, "", "apply_diag_coulomb_evolution"]], "ffsim.gates.num_op_sum": [[2, 1, 1, "", "apply_num_op_sum_evolution"]], "ffsim.gates.orbital_rotation": [[2, 1, 1, "", "apply_orbital_rotation"], [2, 1, 1, "", "gen_orbital_rotation_index"]], "ffsim.hamiltonians": [[3, 0, 0, "-", "double_factorized_hamiltonian"], [3, 0, 0, "-", "molecular_hamiltonian"]], "ffsim.hamiltonians.double_factorized_hamiltonian": [[3, 2, 1, "", "DoubleFactorizedHamiltonian"], [3, 1, 1, "", "double_factorized_hamiltonian"]], "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian": [[3, 3, 1, "", "constant"], [3, 3, 1, "", "diag_coulomb_mats"], [3, 4, 1, "", "norb"], [3, 3, 1, "", "one_body_tensor"], [3, 3, 1, "", "orbital_rotations"], [3, 5, 1, "", "to_number_representation"], [3, 5, 1, "", "to_z_representation"], [3, 3, 1, "", "z_representation"]], "ffsim.hamiltonians.molecular_hamiltonian": [[3, 2, 1, "", "MolecularHamiltonian"]], "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian": [[3, 3, 1, "", "constant"], [3, 4, 1, "", "norb"], [3, 3, 1, "", "one_body_tensor"], [3, 3, 1, "", "two_body_tensor"]], "ffsim.linalg": [[4, 0, 0, "-", "double_factorized"], [4, 0, 0, "-", "givens"], [4, 0, 0, "-", "linalg"], [4, 0, 0, "-", "predicates"]], "ffsim.linalg.double_factorized": [[4, 1, 1, "", "double_factorized"], [4, 1, 1, "", "double_factorized_t2"], [4, 1, 1, "", "modified_cholesky"], [4, 1, 1, "", "optimal_diag_coulomb_mats"]], "ffsim.linalg.givens": [[4, 1, 1, "", "apply_matrix_to_slices"], [4, 1, 1, "", "givens_decomposition"], [4, 1, 1, "", "zrotg"]], "ffsim.linalg.linalg": [[4, 1, 1, "", "expm_multiply_taylor"], [4, 1, 1, "", "lup"]], "ffsim.linalg.predicates": [[4, 1, 1, "", "is_antihermitian"], [4, 1, 1, "", "is_hermitian"], [4, 1, 1, "", "is_orthogonal"], [4, 1, 1, "", "is_real_symmetric"], [4, 1, 1, "", "is_special_orthogonal"], [4, 1, 1, "", "is_unitary"]], "ffsim.molecular_data": [[0, 2, 1, "", "MolecularData"]], "ffsim.protocols": [[5, 0, 0, "-", "approximate_equality"], [5, 0, 0, "-", "linear_operator"], [5, 0, 0, "-", "trace"]], "ffsim.protocols.approximate_equality": [[5, 2, 1, "", "SupportsApproximateEquality"], [5, 1, 1, "", "approx_eq"]], "ffsim.protocols.linear_operator": [[5, 2, 1, "", "SupportsLinearOperator"], [5, 1, 1, "", "linear_operator"]], "ffsim.protocols.trace": [[5, 2, 1, "", "SupportsTrace"], [5, 1, 1, "", "trace"]], "ffsim.random": [[0, 1, 1, "", "random_antihermitian"], [0, 1, 1, "", "random_hermitian"], [0, 1, 1, "", "random_orthogonal"], [0, 1, 1, "", "random_real_symmetric_matrix"], [0, 1, 1, "", "random_special_orthogonal"], [0, 1, 1, "", "random_statevector"], [0, 1, 1, "", "random_t2_amplitudes"], [0, 1, 1, "", "random_two_body_tensor_real"], [0, 1, 1, "", "random_unitary"]], "ffsim.states": [[0, 1, 1, "", "dim"], [0, 1, 1, "", "dims"], [0, 1, 1, "", "one_hot"], [0, 1, 1, "", "slater_determinant"], [0, 1, 1, "", "slater_determinant_one_rdm"]], "ffsim.testing": [[0, 1, 1, "", "random_nelec"], [0, 1, 1, "", "random_occupied_orbitals"]], "ffsim.trotter": [[6, 0, 0, "-", "qdrift"], [6, 0, 0, "-", "trotter"]], "ffsim.trotter.qdrift": [[6, 1, 1, "", "expectation_squared_diag_coulomb"], [6, 1, 1, "", "one_body_square_decomposition"], [6, 1, 1, "", "qdrift_probabilities"], [6, 1, 1, "", "simulate_qdrift_double_factorized"], [6, 1, 1, "", "spectral_norm_diag_coulomb"], [6, 1, 1, "", "spectral_norm_one_body_tensor"], [6, 1, 1, "", "variance_diag_coulomb"], [6, 1, 1, "", "variance_one_body_tensor"]], "ffsim.trotter.trotter": [[6, 1, 1, "", "simulate_trotter_double_factorized"]], "ffsim.variational": [[7, 0, 0, "-", "lucj"]], "ffsim.variational.lucj": [[7, 2, 1, "", "UCJOperator"], [7, 1, 1, "", "apply_ucj_operator"]], "ffsim.variational.lucj.UCJOperator": [[7, 3, 1, "", "diag_coulomb_mats_alpha_alpha"], [7, 3, 1, "", "diag_coulomb_mats_alpha_beta"], [7, 3, 1, "", "final_orbital_rotation"], [7, 5, 1, "", "from_parameters"], [7, 5, 1, "", "from_t_amplitudes"], [7, 4, 1, "", "n_reps"], [7, 4, 1, "", "norb"], [7, 3, 1, "", "orbital_rotations"], [7, 5, 1, "", "to_parameters"], [7, 5, 1, "", "to_t_amplitudes"]], "ffsim.wick": [[0, 1, 1, "", "expectation_power"], [0, 1, 1, "", "expectation_product"]]}, "objtypes": {"0": "py:module", "1": "py:function", "2": "py:class", "3": "py:attribute", "4": "py:property", "5": "py:method"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"], "2": ["py", "class", "Python class"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "property", "Python property"], "5": ["py", "method", "Python method"]}, "titleterms": {"ffsim": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11], "packag": [0, 1, 2, 3, 4, 5, 6, 7], "subpackag": 0, "submodul": [0, 1, 2, 3, 4, 5, 6, 7], "fermion_act": 0, "modul": [0, 1, 2, 3, 4, 5, 6, 7], "molecular_data": 0, "random": 0, "state": 0, "test": 0, "wick": 0, "content": [0, 1, 2, 3, 4, 5, 6, 7, 10, 16], "contract": 1, "diag_coulomb": [1, 2], "hamiltonian": [1, 3, 12, 13], "num_op_sum": [1, 2], "gate": 2, "basic_g": 2, "orbital_rot": 2, "double_factorized_hamiltonian": 3, "molecular_hamiltonian": 3, "linalg": 4, "double_factor": 4, "given": 4, "predic": 4, "protocol": 5, "approximate_equ": 5, "linear_oper": 5, "trace": 5, "trotter": [6, 13], "qdrift": 6, "variat": 7, "lucj": [7, 14], "api": 9, "refer": 9, "document": 10, "indic": 10, "tabl": 10, "introduct": 11, "orbit": 12, "rotat": 12, "quadrat": 12, "time": 12, "evolut": 12, "diagon": 13, "coulomb": 13, "oper": 13, "doubl": 13, "factor": 13, "simul": 13, "represent": 13, "molecular": 13, "brief": 13, "background": 13, "suzuki": 13, "formula": 13, "implement": 13, "The": [14, 15], "local": 14, "unitari": 14, "cluster": 14, "jastrow": 14, "ansatz": 14, "ucj": 14, "fermionoper": 15, "class": 15, "tutori": 16}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "nbsphinx": 4, "sphinx": 60}, "alltitles": {"ffsim package": [[0, "ffsim-package"]], "Subpackages": [[0, "subpackages"]], "Submodules": [[0, "submodules"], [1, "submodules"], [2, "submodules"], [3, "submodules"], [4, "submodules"], [5, "submodules"], [6, "submodules"], [7, "submodules"]], "ffsim.fermion_action module": [[0, "module-ffsim.fermion_action"]], "ffsim.molecular_data module": [[0, "module-ffsim.molecular_data"]], "ffsim.random module": [[0, "module-ffsim.random"]], "ffsim.states module": [[0, "module-ffsim.states"]], "ffsim.testing module": [[0, "module-ffsim.testing"]], "ffsim.wick module": [[0, "module-ffsim.wick"]], "Module contents": [[0, "module-ffsim"], [1, "module-ffsim.contract"], [2, "module-ffsim.gates"], [3, "module-ffsim.hamiltonians"], [4, "module-ffsim.linalg"], [5, "module-ffsim.protocols"], [6, "module-ffsim.trotter"], [7, "module-ffsim.variational"]], "ffsim.contract package": [[1, "ffsim-contract-package"]], "ffsim.contract.diag_coulomb module": [[1, "module-ffsim.contract.diag_coulomb"]], "ffsim.contract.hamiltonian module": [[1, "module-ffsim.contract.hamiltonian"]], "ffsim.contract.num_op_sum module": [[1, "module-ffsim.contract.num_op_sum"]], "ffsim.gates package": [[2, "ffsim-gates-package"]], "ffsim.gates.basic_gates module": [[2, "module-ffsim.gates.basic_gates"]], "ffsim.gates.diag_coulomb module": [[2, "module-ffsim.gates.diag_coulomb"]], "ffsim.gates.num_op_sum module": [[2, "module-ffsim.gates.num_op_sum"]], "ffsim.gates.orbital_rotation module": [[2, "module-ffsim.gates.orbital_rotation"]], "ffsim.hamiltonians package": [[3, "ffsim-hamiltonians-package"]], "ffsim.hamiltonians.double_factorized_hamiltonian module": [[3, "module-ffsim.hamiltonians.double_factorized_hamiltonian"]], "ffsim.hamiltonians.molecular_hamiltonian module": [[3, "module-ffsim.hamiltonians.molecular_hamiltonian"]], "ffsim.linalg package": [[4, "ffsim-linalg-package"]], "ffsim.linalg.double_factorized module": [[4, "module-ffsim.linalg.double_factorized"]], "ffsim.linalg.givens module": [[4, "module-ffsim.linalg.givens"]], "ffsim.linalg.linalg module": [[4, "module-ffsim.linalg.linalg"]], "ffsim.linalg.predicates module": [[4, "module-ffsim.linalg.predicates"]], "ffsim.protocols package": [[5, "ffsim-protocols-package"]], "ffsim.protocols.approximate_equality module": [[5, "module-ffsim.protocols.approximate_equality"]], "ffsim.protocols.linear_operator module": [[5, "module-ffsim.protocols.linear_operator"]], "ffsim.protocols.trace module": [[5, "module-ffsim.protocols.trace"]], "ffsim.trotter package": [[6, "ffsim-trotter-package"]], "ffsim.trotter.qdrift module": [[6, "module-ffsim.trotter.qdrift"]], "ffsim.trotter.trotter module": [[6, "module-ffsim.trotter.trotter"]], "ffsim.variational package": [[7, "ffsim-variational-package"]], "ffsim.variational.lucj module": [[7, "module-ffsim.variational.lucj"]], "ffsim": [[8, "ffsim"]], "API reference": [[9, "api-reference"]], "ffsim documentation": [[10, "ffsim-documentation"]], "Contents:": [[10, null], [16, null]], "Indices and tables": [[10, "indices-and-tables"]], "Introduction to ffsim": [[11, "Introduction-to-ffsim"]], "Orbital rotations and quadratic Hamiltonians": [[12, "Orbital-rotations-and-quadratic-Hamiltonians"]], "Orbital rotations": [[12, "Orbital-rotations"]], "Time evolution by a quadratic Hamiltonian": [[12, "Time-evolution-by-a-quadratic-Hamiltonian"]], "Diagonal Coulomb operators and double-factorized Trotter simulation": [[13, "Diagonal-Coulomb-operators-and-double-factorized-Trotter-simulation"]], "Double-factorized representation of the molecular Hamiltonian": [[13, "Double-factorized-representation-of-the-molecular-Hamiltonian"]], "Trotter simulation of the double-factorized Hamiltonian": [[13, "Trotter-simulation-of-the-double-factorized-Hamiltonian"]], "Brief background on Trotter-Suzuki formulas": [[13, "Brief-background-on-Trotter-Suzuki-formulas"]], "Implementing Trotter simulation of the double-factorized Hamiltonian": [[13, "Implementing-Trotter-simulation-of-the-double-factorized-Hamiltonian"]], "The local unitary cluster Jastrow (LUCJ) ansatz": [[14, "The-local-unitary-cluster-Jastrow-(LUCJ)-ansatz"], [14, "id1"]], "The unitary cluster Jastrow (UCJ) ansatz": [[14, "The-unitary-cluster-Jastrow-(UCJ)-ansatz"]], "The FermionOperator class": [[15, "The-FermionOperator-class"]], "Tutorials": [[16, "tutorials"]]}, "indexentries": {"fermionaction (class in ffsim.fermion_action)": [[0, "ffsim.fermion_action.FermionAction"]], "moleculardata (class in ffsim.molecular_data)": [[0, "ffsim.molecular_data.MolecularData"]], "action (ffsim.fermion_action.fermionaction attribute)": [[0, "ffsim.fermion_action.FermionAction.action"]], "cre() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.cre"]], "cre_a() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.cre_a"]], "cre_b() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.cre_b"]], "des() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.des"]], "des_a() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.des_a"]], "des_b() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.des_b"]], "dim() (in module ffsim.states)": [[0, "ffsim.states.dim"]], "dims() (in module ffsim.states)": [[0, "ffsim.states.dims"]], "expectation_power() (in module ffsim.wick)": [[0, "ffsim.wick.expectation_power"]], "expectation_product() (in module ffsim.wick)": [[0, "ffsim.wick.expectation_product"]], "ffsim": [[0, "module-ffsim"]], "ffsim.fermion_action": [[0, "module-ffsim.fermion_action"]], "ffsim.molecular_data": [[0, "module-ffsim.molecular_data"]], "ffsim.random": [[0, "module-ffsim.random"]], "ffsim.states": [[0, "module-ffsim.states"]], "ffsim.testing": [[0, "module-ffsim.testing"]], "ffsim.wick": [[0, "module-ffsim.wick"]], "module": [[0, "module-ffsim"], [0, "module-ffsim.fermion_action"], [0, "module-ffsim.molecular_data"], [0, "module-ffsim.random"], [0, "module-ffsim.states"], [0, "module-ffsim.testing"], [0, "module-ffsim.wick"], [1, "module-ffsim.contract"], [1, "module-ffsim.contract.diag_coulomb"], [1, "module-ffsim.contract.hamiltonian"], [1, "module-ffsim.contract.num_op_sum"], [2, "module-ffsim.gates"], [2, "module-ffsim.gates.basic_gates"], [2, "module-ffsim.gates.diag_coulomb"], [2, "module-ffsim.gates.num_op_sum"], [2, "module-ffsim.gates.orbital_rotation"], [3, "module-ffsim.hamiltonians"], [3, "module-ffsim.hamiltonians.double_factorized_hamiltonian"], [3, "module-ffsim.hamiltonians.molecular_hamiltonian"], [4, "module-ffsim.linalg"], [4, "module-ffsim.linalg.double_factorized"], [4, "module-ffsim.linalg.givens"], [4, "module-ffsim.linalg.linalg"], [4, "module-ffsim.linalg.predicates"], [5, "module-ffsim.protocols"], [5, "module-ffsim.protocols.approximate_equality"], [5, "module-ffsim.protocols.linear_operator"], [5, "module-ffsim.protocols.trace"], [6, "module-ffsim.trotter"], [6, "module-ffsim.trotter.qdrift"], [6, "module-ffsim.trotter.trotter"], [7, "module-ffsim.variational"], [7, "module-ffsim.variational.lucj"]], "one_hot() (in module ffsim.states)": [[0, "ffsim.states.one_hot"]], "orb (ffsim.fermion_action.fermionaction attribute)": [[0, "ffsim.fermion_action.FermionAction.orb"]], "random_antihermitian() (in module ffsim.random)": [[0, "ffsim.random.random_antihermitian"]], "random_hermitian() (in module ffsim.random)": [[0, "ffsim.random.random_hermitian"]], "random_nelec() (in module ffsim.testing)": [[0, "ffsim.testing.random_nelec"]], "random_occupied_orbitals() (in module ffsim.testing)": [[0, "ffsim.testing.random_occupied_orbitals"]], "random_orthogonal() (in module ffsim.random)": [[0, "ffsim.random.random_orthogonal"]], "random_real_symmetric_matrix() (in module ffsim.random)": [[0, "ffsim.random.random_real_symmetric_matrix"]], "random_special_orthogonal() (in module ffsim.random)": [[0, "ffsim.random.random_special_orthogonal"]], "random_statevector() (in module ffsim.random)": [[0, "ffsim.random.random_statevector"]], "random_t2_amplitudes() (in module ffsim.random)": [[0, "ffsim.random.random_t2_amplitudes"]], "random_two_body_tensor_real() (in module ffsim.random)": [[0, "ffsim.random.random_two_body_tensor_real"]], "random_unitary() (in module ffsim.random)": [[0, "ffsim.random.random_unitary"]], "slater_determinant() (in module ffsim.states)": [[0, "ffsim.states.slater_determinant"]], "slater_determinant_one_rdm() (in module ffsim.states)": [[0, "ffsim.states.slater_determinant_one_rdm"]], "spin (ffsim.fermion_action.fermionaction attribute)": [[0, "ffsim.fermion_action.FermionAction.spin"]], "contract_diag_coulomb() (in module ffsim.contract.diag_coulomb)": [[1, "ffsim.contract.diag_coulomb.contract_diag_coulomb"]], "contract_num_op_sum() (in module ffsim.contract.num_op_sum)": [[1, "ffsim.contract.num_op_sum.contract_num_op_sum"]], "diag_coulomb_linop() (in module ffsim.contract.diag_coulomb)": [[1, "ffsim.contract.diag_coulomb.diag_coulomb_linop"]], "ffsim.contract": [[1, "module-ffsim.contract"]], "ffsim.contract.diag_coulomb": [[1, "module-ffsim.contract.diag_coulomb"]], "ffsim.contract.hamiltonian": [[1, "module-ffsim.contract.hamiltonian"]], "ffsim.contract.num_op_sum": [[1, "module-ffsim.contract.num_op_sum"]], "hamiltonian_linop() (in module ffsim.contract.hamiltonian)": [[1, "ffsim.contract.hamiltonian.hamiltonian_linop"]], "hamiltonian_trace() (in module ffsim.contract.hamiltonian)": [[1, "ffsim.contract.hamiltonian.hamiltonian_trace"]], "num_op_sum_linop() (in module ffsim.contract.num_op_sum)": [[1, "ffsim.contract.num_op_sum.num_op_sum_linop"]], "apply_diag_coulomb_evolution() (in module ffsim.gates.diag_coulomb)": [[2, "ffsim.gates.diag_coulomb.apply_diag_coulomb_evolution"]], "apply_fsim_gate() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_fsim_gate"]], "apply_givens_rotation() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_givens_rotation"]], "apply_hop_gate() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_hop_gate"]], "apply_num_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_num_interaction"]], "apply_num_num_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_num_num_interaction"]], "apply_num_op_prod_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_num_op_prod_interaction"]], "apply_num_op_sum_evolution() (in module ffsim.gates.num_op_sum)": [[2, "ffsim.gates.num_op_sum.apply_num_op_sum_evolution"]], "apply_orbital_rotation() (in module ffsim.gates.orbital_rotation)": [[2, "ffsim.gates.orbital_rotation.apply_orbital_rotation"]], "apply_tunneling_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_tunneling_interaction"]], "ffsim.gates": [[2, "module-ffsim.gates"]], "ffsim.gates.basic_gates": [[2, "module-ffsim.gates.basic_gates"]], "ffsim.gates.diag_coulomb": [[2, "module-ffsim.gates.diag_coulomb"]], "ffsim.gates.num_op_sum": [[2, "module-ffsim.gates.num_op_sum"]], "ffsim.gates.orbital_rotation": [[2, "module-ffsim.gates.orbital_rotation"]], "gen_orbital_rotation_index() (in module ffsim.gates.orbital_rotation)": [[2, "ffsim.gates.orbital_rotation.gen_orbital_rotation_index"]], "doublefactorizedhamiltonian (class in ffsim.hamiltonians.double_factorized_hamiltonian)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian"]], "molecularhamiltonian (class in ffsim.hamiltonians.molecular_hamiltonian)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian"]], "constant (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.constant"]], "constant (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian attribute)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.constant"]], "diag_coulomb_mats (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.diag_coulomb_mats"]], "double_factorized_hamiltonian() (in module ffsim.hamiltonians.double_factorized_hamiltonian)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.double_factorized_hamiltonian"]], "ffsim.hamiltonians": [[3, "module-ffsim.hamiltonians"]], "ffsim.hamiltonians.double_factorized_hamiltonian": [[3, "module-ffsim.hamiltonians.double_factorized_hamiltonian"]], "ffsim.hamiltonians.molecular_hamiltonian": [[3, "module-ffsim.hamiltonians.molecular_hamiltonian"]], "norb (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian property)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.norb"]], "norb (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian property)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.norb"]], "one_body_tensor (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.one_body_tensor"]], "one_body_tensor (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian attribute)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.one_body_tensor"]], "orbital_rotations (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.orbital_rotations"]], "to_number_representation() (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian method)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.to_number_representation"]], "to_z_representation() (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian method)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.to_z_representation"]], "two_body_tensor (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian attribute)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.two_body_tensor"]], "z_representation (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.z_representation"]], "apply_matrix_to_slices() (in module ffsim.linalg.givens)": [[4, "ffsim.linalg.givens.apply_matrix_to_slices"]], "double_factorized() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.double_factorized"]], "double_factorized_t2() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.double_factorized_t2"]], "expm_multiply_taylor() (in module ffsim.linalg.linalg)": [[4, "ffsim.linalg.linalg.expm_multiply_taylor"]], "ffsim.linalg": [[4, "module-ffsim.linalg"]], "ffsim.linalg.double_factorized": [[4, "module-ffsim.linalg.double_factorized"]], "ffsim.linalg.givens": [[4, "module-ffsim.linalg.givens"]], "ffsim.linalg.linalg": [[4, "module-ffsim.linalg.linalg"]], "ffsim.linalg.predicates": [[4, "module-ffsim.linalg.predicates"]], "givens_decomposition() (in module ffsim.linalg.givens)": [[4, "ffsim.linalg.givens.givens_decomposition"]], "is_antihermitian() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_antihermitian"]], "is_hermitian() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_hermitian"]], "is_orthogonal() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_orthogonal"]], "is_real_symmetric() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_real_symmetric"]], "is_special_orthogonal() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_special_orthogonal"]], "is_unitary() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_unitary"]], "lup() (in module ffsim.linalg.linalg)": [[4, "ffsim.linalg.linalg.lup"]], "modified_cholesky() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.modified_cholesky"]], "optimal_diag_coulomb_mats() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.optimal_diag_coulomb_mats"]], "zrotg() (in module ffsim.linalg.givens)": [[4, "ffsim.linalg.givens.zrotg"]], "supportsapproximateequality (class in ffsim.protocols.approximate_equality)": [[5, "ffsim.protocols.approximate_equality.SupportsApproximateEquality"]], "supportslinearoperator (class in ffsim.protocols.linear_operator)": [[5, "ffsim.protocols.linear_operator.SupportsLinearOperator"]], "supportstrace (class in ffsim.protocols.trace)": [[5, "ffsim.protocols.trace.SupportsTrace"]], "approx_eq() (in module ffsim.protocols.approximate_equality)": [[5, "ffsim.protocols.approximate_equality.approx_eq"]], "ffsim.protocols": [[5, "module-ffsim.protocols"]], "ffsim.protocols.approximate_equality": [[5, "module-ffsim.protocols.approximate_equality"]], "ffsim.protocols.linear_operator": [[5, "module-ffsim.protocols.linear_operator"]], "ffsim.protocols.trace": [[5, "module-ffsim.protocols.trace"]], "linear_operator() (in module ffsim.protocols.linear_operator)": [[5, "ffsim.protocols.linear_operator.linear_operator"]], "trace() (in module ffsim.protocols.trace)": [[5, "ffsim.protocols.trace.trace"]], "expectation_squared_diag_coulomb() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.expectation_squared_diag_coulomb"]], "ffsim.trotter": [[6, "module-ffsim.trotter"]], "ffsim.trotter.qdrift": [[6, "module-ffsim.trotter.qdrift"]], "ffsim.trotter.trotter": [[6, "module-ffsim.trotter.trotter"]], "one_body_square_decomposition() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.one_body_square_decomposition"]], "qdrift_probabilities() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.qdrift_probabilities"]], "simulate_qdrift_double_factorized() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.simulate_qdrift_double_factorized"]], "simulate_trotter_double_factorized() (in module ffsim.trotter.trotter)": [[6, "ffsim.trotter.trotter.simulate_trotter_double_factorized"]], "spectral_norm_diag_coulomb() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.spectral_norm_diag_coulomb"]], "spectral_norm_one_body_tensor() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.spectral_norm_one_body_tensor"]], "variance_diag_coulomb() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.variance_diag_coulomb"]], "variance_one_body_tensor() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.variance_one_body_tensor"]], "ucjoperator (class in ffsim.variational.lucj)": [[7, "ffsim.variational.lucj.UCJOperator"]], "apply_ucj_operator() (in module ffsim.variational.lucj)": [[7, "ffsim.variational.lucj.apply_ucj_operator"]], "diag_coulomb_mats_alpha_alpha (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.diag_coulomb_mats_alpha_alpha"]], "diag_coulomb_mats_alpha_beta (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.diag_coulomb_mats_alpha_beta"]], "ffsim.variational": [[7, "module-ffsim.variational"]], "ffsim.variational.lucj": [[7, "module-ffsim.variational.lucj"]], "final_orbital_rotation (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.final_orbital_rotation"]], "from_parameters() (ffsim.variational.lucj.ucjoperator static method)": [[7, "ffsim.variational.lucj.UCJOperator.from_parameters"]], "from_t_amplitudes() (ffsim.variational.lucj.ucjoperator static method)": [[7, "ffsim.variational.lucj.UCJOperator.from_t_amplitudes"]], "n_reps (ffsim.variational.lucj.ucjoperator property)": [[7, "ffsim.variational.lucj.UCJOperator.n_reps"]], "norb (ffsim.variational.lucj.ucjoperator property)": [[7, "ffsim.variational.lucj.UCJOperator.norb"]], "orbital_rotations (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.orbital_rotations"]], "to_parameters() (ffsim.variational.lucj.ucjoperator method)": [[7, "ffsim.variational.lucj.UCJOperator.to_parameters"]], "to_t_amplitudes() (ffsim.variational.lucj.ucjoperator method)": [[7, "ffsim.variational.lucj.UCJOperator.to_t_amplitudes"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["api/generated/ffsim", "api/generated/ffsim.contract", "api/generated/ffsim.gates", "api/generated/ffsim.hamiltonians", "api/generated/ffsim.linalg", "api/generated/ffsim.protocols", "api/generated/ffsim.trotter", "api/generated/ffsim.variational", "api/generated/modules", "api/index", "index", "tutorials/01-introduction", "tutorials/02-orbital-rotation", "tutorials/03-double-factorized", "tutorials/04-lucj", "tutorials/05-fermion-operator", "tutorials/index"], "filenames": ["api/generated/ffsim.rst", "api/generated/ffsim.contract.rst", "api/generated/ffsim.gates.rst", "api/generated/ffsim.hamiltonians.rst", "api/generated/ffsim.linalg.rst", "api/generated/ffsim.protocols.rst", "api/generated/ffsim.trotter.rst", "api/generated/ffsim.variational.rst", "api/generated/modules.rst", "api/index.rst", "index.rst", "tutorials/01-introduction.ipynb", "tutorials/02-orbital-rotation.ipynb", "tutorials/03-double-factorized.ipynb", "tutorials/04-lucj.ipynb", "tutorials/05-fermion-operator.ipynb", "tutorials/index.rst"], "titles": ["ffsim package", "ffsim.contract package", "ffsim.gates package", "ffsim.hamiltonians package", "ffsim.linalg package", "ffsim.protocols package", "ffsim.trotter package", "ffsim.variational package", "ffsim", "API reference", "ffsim documentation", "Introduction to ffsim", "Orbital rotations and quadratic Hamiltonians", "Diagonal Coulomb operators and double-factorized Trotter simulation", "The local unitary cluster Jastrow (LUCJ) ansatz", "The FermionOperator class", "Tutorials"], "terms": {"contract": [0, 8, 9, 12], "diag_coulomb": [0, 8], "contract_diag_coulomb": [0, 1], "diag_coulomb_linop": [0, 1], "hamiltonian": [0, 6, 8, 9, 14, 16], "hamiltonian_linop": [0, 1, 12], "hamiltonian_trac": [0, 1], "num_op_sum": [0, 8], "contract_num_op_sum": [0, 1], "num_op_sum_linop": [0, 1], "gate": [0, 8, 9, 14], "basic_g": [0, 8], "apply_fsim_g": [0, 2], "apply_givens_rot": [0, 2], "apply_hop_g": [0, 2], "apply_num_interact": [0, 2], "apply_num_num_interact": [0, 2], "apply_num_op_prod_interact": [0, 2], "apply_tunneling_interact": [0, 2], "apply_diag_coulomb_evolut": [0, 2, 13], "apply_num_op_sum_evolut": [0, 2, 12, 13], "orbital_rot": [0, 1, 3, 4, 6, 7, 8, 11, 12, 13], "apply_orbital_rot": [0, 2, 11, 12], "gen_orbital_rotation_index": [0, 2], "double_factorized_hamiltonian": [0, 8], "doublefactorizedhamiltonian": [0, 3, 6, 13], "one_body_tensor": [0, 1, 3, 6, 12, 13], "diag_coulomb_mat": [0, 3, 6, 13], "constant": [0, 1, 3, 13, 14], "z_represent": [0, 1, 2, 3, 6], "from_molecular_hamiltonian": [0, 3, 13], "norb": [0, 1, 2, 3, 5, 6, 7, 11, 12, 13, 14, 15], "to_number_represent": [0, 3], "to_z_represent": [0, 3], "molecular_hamiltonian": [0, 8], "molecularhamiltonian": [0, 3, 13], "two_body_tensor": [0, 1, 3, 4, 13], "linalg": [0, 8, 9, 12, 13, 15], "double_factor": [0, 8], "double_factorized_t2": [0, 4], "modified_choleski": [0, 4], "optimal_diag_coulomb_mat": [0, 4], "given": [0, 1, 2, 6, 8, 12, 13], "apply_matrix_to_slic": [0, 4], "givens_decomposit": [0, 4], "zrotg": [0, 4], "expm_multiply_taylor": [0, 4], "lup": [0, 4], "predic": [0, 8], "is_antihermitian": [0, 4], "is_hermitian": [0, 4], "is_orthogon": [0, 4], "is_real_symmetr": [0, 4], "is_special_orthogon": [0, 4], "is_unitari": [0, 4], "protocol": [0, 8, 9], "approximate_equ": [0, 8], "supportsapproximateequ": [0, 5], "approx_eq": [0, 5], "linear_oper": [0, 8, 13, 14, 15], "supportslinearoper": [0, 5], "trace": [0, 1, 8, 13], "supportstrac": [0, 5], "trotter": [0, 8, 9, 16], "qdrift": [0, 8], "expectation_squared_diag_coulomb": [0, 6], "one_body_square_decomposit": [0, 6], "qdrift_prob": [0, 6], "simulate_qdrift_double_factor": [0, 6], "spectral_norm_diag_coulomb": [0, 6], "spectral_norm_one_body_tensor": [0, 6], "variance_diag_coulomb": [0, 6], "variance_one_body_tensor": [0, 6], "simulate_trotter_double_factor": [0, 6, 13], "variat": [0, 8, 9, 14], "lucj": [0, 8, 16], "ucjoper": [0, 7, 14], "diag_coulomb_mats_alpha_alpha": [0, 7], "diag_coulomb_mats_alpha_beta": [0, 7], "final_orbital_rot": [0, 7], "from_paramet": [0, 7, 14], "from_t_amplitud": [0, 7, 14], "n_rep": [0, 7, 14], "to_paramet": [0, 7, 14], "to_t_amplitud": [0, 7], "apply_ucj_oper": [0, 7, 14], "The": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 16], "fermionact": [0, 8, 9], "namedtupl": 0, "construct": [0, 1, 13, 14, 15], "function": [0, 1, 2, 3, 4, 6, 7, 11, 12, 13, 14, 15], "class": [0, 3, 5, 7, 11, 14, 16], "action": [0, 1, 8, 12, 15], "bool": [0, 1, 2, 3, 4, 5, 6, 7], "spin": [0, 1, 2, 7, 8, 11, 12, 14, 15], "orb": [0, 8, 15], "int": [0, 1, 2, 3, 4, 5, 6, 7, 13], "sourc": [0, 1, 2, 3, 4, 5, 6, 7], "base": [0, 3, 4, 5, 7, 14], "A": [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15], "fermion": [0, 2, 10, 11, 12, 14, 15], "creat": [0, 2, 11, 12, 13, 14, 15], "new": [0, 12, 15], "instanc": [0, 12, 13], "alia": 0, "field": 0, "number": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15], "0": [0, 1, 2, 3, 6, 12, 13, 14, 15], "2": [0, 1, 2, 3, 4, 11, 12, 13, 14, 15], "1": [0, 2, 3, 4, 6, 7, 11, 12, 13, 14, 15], "cre": [0, 8, 9], "paramet": [0, 1, 2, 3, 4, 5, 6, 7, 14], "orbit": [0, 1, 2, 3, 4, 5, 6, 7, 11, 13, 14, 15, 16], "fals": [0, 1, 2, 3, 4, 5, 6, 7, 15], "alpha": [0, 1, 2, 5, 6, 7, 11, 14, 15], "true": [0, 2, 3, 4, 5, 6, 7, 11, 14, 15], "beta": [0, 1, 2, 5, 6, 7, 11, 14, 15], "index": [0, 2, 10, 11, 14, 15], "act": [0, 3, 15], "return": [0, 1, 2, 3, 4, 5, 6, 7, 13, 14, 15], "type": [0, 1, 2, 3, 4, 5, 6, 7], "cre_a": [0, 8, 9, 15], "cre_b": [0, 8, 9, 15], "de": [0, 8, 9], "destroi": [0, 15], "des_a": [0, 8, 9, 15], "des_b": [0, 8, 9, 15], "moleculardata": [0, 8, 9, 13, 14], "nelec": [0, 1, 2, 5, 6, 7, 11, 12, 13, 14, 15], "core_energi": 0, "dipole_integr": 0, "none": [0, 1, 2, 3, 4, 6, 7], "orbital_symmetri": 0, "object": [0, 3, 4, 5, 7, 14, 15], "random_antihermitian": [0, 8, 9], "dim": [0, 6, 8, 9, 11, 15], "seed": [0, 6, 11, 12], "dtype": [0, 14], "complex": [0, 4], "anti": [0, 4], "hermitian": [0, 4, 12], "matrix": [0, 1, 2, 3, 4, 6, 11, 12, 13, 14, 15], "width": 0, "height": 0, "rank": [0, 3, 4], "If": [0, 1, 2, 3, 4, 6, 7, 15], "maximum": [0, 3, 4], "i": [0, 1, 2, 3, 4, 6, 7, 11, 12, 13, 14, 15], "us": [0, 1, 2, 3, 4, 6, 11, 12, 13, 14, 15], "initi": [0, 6, 7, 13, 14], "pseudorandom": [0, 6], "gener": [0, 2, 6, 11, 12, 13, 14], "should": [0, 6, 12, 13], "valid": [0, 6], "input": [0, 1, 6, 14], "np": [0, 2, 5, 6, 12, 13, 14], "default_rng": [0, 6], "dype": 0, "data": [0, 2, 6, 7, 13, 14, 15], "result": [0, 1, 4, 7, 12, 13, 14], "ndarrai": [0, 1, 2, 3, 4, 6, 7, 13], "sampl": [0, 6], "random_hermitian": [0, 8, 9, 12], "random_orthogon": [0, 8, 9], "float": [0, 1, 2, 3, 4, 5, 6, 13], "orthogon": [0, 4], "distribut": 0, "haar": 0, "measur": 0, "an": [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15], "els": [0, 6], "refer": [0, 3, 4, 10, 14], "arxiv": [0, 3, 4], "math": 0, "ph": 0, "0609050": 0, "random_real_symmetric_matrix": [0, 8, 9], "real": [0, 1, 2, 3, 4, 7, 12, 13, 14], "symmetr": [0, 1, 2, 3, 4, 6, 13, 14], "option": [0, 1, 2, 3, 4, 6, 7, 14], "random_special_orthogon": [0, 8, 9], "special": [0, 4, 11], "random_statevector": [0, 8, 9, 15], "vector": [0, 1, 2, 4, 6, 7, 11, 12, 14, 15], "from": [0, 7, 11, 12, 14, 15], "uniform": [0, 6], "dimens": [0, 6, 11], "random_t2_amplitud": [0, 8, 9], "nocc": [0, 2, 7], "t2": [0, 4, 7, 14], "amplitud": [0, 4, 7, 14], "tensor": [0, 1, 3, 4, 6, 13, 14], "ar": [0, 1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15], "occupi": [0, 1, 2, 13], "electron": [0, 1, 2, 5, 6, 7, 11, 13], "random_two_body_tensor_r": [0, 8, 9], "two": [0, 1, 2, 3, 4, 5, 6, 7, 13, 14], "bodi": [0, 1, 3, 4, 6, 13, 14], "valu": [0, 3, 4, 6, 7, 13, 14], "shape": [0, 4, 6, 11, 14], "default": [0, 3, 4], "behavior": [0, 3, 4], "which": [0, 2, 3, 4, 11, 12, 13, 14, 15], "random_unitari": [0, 8, 9, 11, 12], "unitari": [0, 1, 2, 3, 4, 7, 12, 13, 16], "get": [0, 1, 12, 13, 14], "fci": [0, 1, 11, 14], "space": [0, 14], "spatial": [0, 1, 2, 3, 5, 7, 11, 13, 14, 15], "tupl": [0, 1, 2, 4, 5, 6, 7, 13, 15], "pair": [0, 2], "integ": [0, 2], "dim_a": [0, 11], "dim_b": [0, 11], "repres": [0, 3, 5, 6, 11, 14, 15], "one_hot": [0, 8, 9], "arrai": [0, 2, 4, 6, 11, 15], "all": [0, 2, 14, 15], "zero": [0, 4], "except": 0, "one": [0, 1, 2, 3, 4, 6, 11, 13, 14], "specifi": [0, 2, 3, 4, 5, 6, 14], "desir": 0, "place": [0, 1, 2, 6, 7, 14, 15], "hot": 0, "slater_determin": [0, 8, 9, 11, 12, 13, 14], "occupied_orbit": [0, 11, 12, 13, 14], "slater": [0, 6, 11, 12, 13], "determin": [0, 4, 6, 11, 12, 13], "sequenc": [0, 2], "list": [0, 1, 2, 4, 6, 14], "first": [0, 2, 4, 5, 6, 12, 13, 14], "second": [0, 2, 4, 13], "rotat": [0, 1, 2, 3, 4, 6, 7, 11, 13, 14, 16], "appli": [0, 1, 2, 4, 7, 11, 12, 13, 14], "configur": [0, 11], "In": [0, 7, 12, 13, 14, 15], "other": [0, 5, 14], "word": [0, 14], "thi": [0, 2, 3, 4, 6, 7, 11, 12, 13, 14], "describ": [0, 1, 2, 7, 11, 12, 13, 14, 15], "slater_determinant_one_rdm": [0, 8, 9], "particl": [0, 6, 11, 12, 15], "reduc": [0, 6], "densiti": [0, 6], "contain": [0, 2, 4, 7, 14, 15], "indic": [0, 3, 4, 14, 15], "similarli": [0, 13], "util": [0, 4], "random_nelec": [0, 8, 9], "n_alpha": [0, 11, 12, 13, 14], "n_beta": [0, 11, 12, 13, 14], "random_occupied_orbit": [0, 8, 9], "occ_a": 0, "occ_b": 0, "expectation_pow": [0, 8, 9], "one_rdm": [0, 6], "power": 0, "expect": [0, 6, 12], "oper": [0, 1, 2, 3, 5, 6, 7, 12, 14, 15, 16], "w": [0, 12, 13], "r": [0, 1, 3, 4, 13], "t": [0, 2, 3, 4, 12, 13], "o": 0, "ha": [0, 1, 2, 4, 7, 11, 12, 13, 14], "form": [0, 1, 2, 3, 4, 7, 12, 13, 14, 15], "sum_": [0, 1, 2, 3, 4, 7, 12, 13, 14], "pq": [0, 1, 3, 4, 13], "m_": 0, "a_p": 0, "dagger": [0, 1, 2, 4, 7, 12, 13, 14, 15], "a_q": 0, "take": [0, 3, 11, 14], "m": [0, 4, 12], "its": [0, 2, 3, 4, 6, 7, 12, 13, 15], "argument": [0, 3, 4, 6, 12], "let": [0, 13, 15], "lvert": [0, 14], "psi": [0, 14], "rangl": [0, 14], "Then": 0, "quantiti": 0, "langl": 0, "rvert": 0, "k": [0, 4, 7, 12, 13, 14, 15], "expectation_product": [0, 8, 9], "product": [0, 2, 13, 15], "matric": [0, 1, 3, 4, 7, 12, 13, 14], "o_1": 0, "o_2": 0, "dot": 0, "o_k": 0, "softwar": [0, 11], "librari": [0, 11], "fast": 0, "simul": [0, 6, 10, 11, 12, 14, 16], "quantum": [0, 2, 3, 10, 11, 13, 14], "circuit": [0, 3, 10, 11], "diagon": [1, 2, 3, 4, 6, 7, 12, 14, 16], "coulomb": [1, 2, 3, 4, 6, 7, 14, 16], "vec": [1, 2, 4, 6, 7, 11, 12, 13, 15], "mat": [1, 2, 4], "mat_alpha_beta": [1, 2], "occupations_a": [1, 2], "occupations_b": [1, 2], "strings_a": [1, 2], "strings_b": [1, 2], "j": [1, 2, 3, 7, 12, 13, 14, 15], "sigma": [1, 2, 3, 7, 12, 13, 14], "tau": [1, 2, 3, 7, 13, 14], "z_": [1, 2], "ij": [1, 2, 3, 7, 12, 13, 14], "n_": [1, 2, 7, 11, 12, 13, 14], "where": [1, 2, 3, 4, 6, 7, 12, 13, 14], "denot": [1, 2, 3, 12], "z": [1, 2, 3, 4, 6, 11, 15], "also": [1, 2, 6, 7, 12, 15], "term": [1, 2, 3, 4, 6, 7, 13, 14, 15], "sum": [1, 2, 6, 13], "differ": [1, 2, 3, 4, 7, 14], "neq": [1, 2, 3], "state": [1, 2, 6, 7, 8, 9, 12, 13, 14], "transform": [1, 2, 3, 7, 11, 12], "coeffici": [1, 2, 3, 4, 7, 12, 14, 15], "interact": [1, 2, 11], "between": [1, 2, 3, 4, 14], "whether": [1, 2, 3, 4, 5, 6, 7, 15], "represent": [1, 3, 4, 6, 11, 15], "string": [1, 2, 6, 11, 15], "convert": [1, 5, 7, 11, 12, 13, 15], "linear": [1, 2, 4, 5, 12, 15], "mathcal": [1, 2, 7, 12, 13, 14], "u": [1, 2, 3, 4], "linearoper": [1, 5, 12, 13, 15], "implement": [1, 4, 11, 12, 14], "molecular": [1, 3, 14], "h": [1, 3, 13, 14], "h_": [1, 3, 4, 13], "dagger_": [1, 2, 3, 12, 13], "p": [1, 2, 3, 4, 13, 14], "a_": [1, 2, 3, 12, 13, 15], "q": [1, 3, 13], "frac12": [1, 3, 7, 13, 14], "pqr": [1, 3, 4, 13], "": [1, 3, 4, 9, 11, 13, 14, 15], "here": [1, 3, 4, 11, 12, 13], "call": [1, 3, 11, 12, 13, 15], "basi": [1, 3, 7, 12, 13, 14], "combin": [1, 2, 12, 15], "coeff": [1, 2], "lambda_i": [1, 2, 12], "basic": [2, 13], "comput": [2, 4, 5, 6, 12, 14], "theta": 2, "phi": 2, "target_orb": 2, "copi": [2, 6, 7, 15], "fsim": 2, "consist": 2, "tunnel": 2, "follow": [2, 6, 11, 12, 13, 14, 15], "note": [2, 3, 4, 14, 15], "neg": 2, "sign": 2, "convent": 2, "angl": 2, "text": [2, 3, 13], "nn": 2, "exp": [2, 12], "left": [2, 6, 7, 12, 15], "dagger_i": 2, "a_i": 2, "dagger_j": 2, "a_j": 2, "right": [2, 12, 15], "under": [2, 3], "jordan": [2, 3], "wigner": [2, 3], "when": [2, 13, 14, 15], "neighbor": 2, "qubit": [2, 14], "begin": [2, 12, 14], "pmatrix": 2, "co": 2, "sin": 2, "e": [2, 6, 7, 13, 14, 15], "end": [2, 7, 12, 14], "befor": [2, 6, 7, 14, 15], "alwai": [2, 4, 6, 7, 12], "newli": [2, 6, 7], "alloc": [2, 6, 7], "origin": [2, 3, 4, 6, 7, 13], "untouch": [2, 6, 7], "mai": [2, 4, 6, 7, 14], "still": [2, 6, 7, 14], "have": [2, 3, 4, 6, 7, 11, 12, 14, 15], "overwritten": [2, 6, 7], "It": [2, 3, 4, 6, 7, 11, 13, 15], "possibl": [2, 3, 4, 6, 7], "modifi": [2, 3, 4, 6, 7], "g": [2, 6, 14], "hop": 2, "pi": [2, 3], "n": [2, 3, 4, 11, 12, 13, 14], "prod": 2, "give": [2, 12], "time": [2, 3, 4, 6, 11, 13], "evolut": [2, 6, 13], "orbital_rotation_index_a": 2, "orbital_rotation_index_b": 2, "evolv": [2, 6, 13], "rais": 2, "valueerror": 2, "must": [2, 4, 15], "dimension": [2, 4, 6, 11], "length": [2, 11, 13, 14], "allow_row_permut": 2, "allow_col_permut": 2, "map": [2, 12, 15], "creation": [2, 12, 15], "mapsto": [2, 12], "u_": 2, "ji": [2, 12], "equival": 2, "log": 2, "_": [2, 3, 4, 7, 12, 13, 14], "allow": [2, 3, 4, 14], "permut": [2, 4], "row": [2, 11], "column": [2, 4, 11, 12], "wa": 2, "well": 2, "actual": [2, 12, 14], "effect": 2, "both": [2, 3, 4], "set": [2, 3, 4, 7, 11, 12, 13, 14], "onli": [2, 3, 4, 11, 12, 14], "linkstr_index": 2, "perform": [2, 3, 4, 7, 12, 13], "diag_str": 2, "off_diag_str": 2, "off_diag_index": 2, "three": [2, 15], "numpi": [2, 4, 6, 11, 12, 13, 14], "x": [2, 14], "binom": 2, "th": [2, 12], "unoccupi": 2, "3": [2, 11, 12, 13, 14, 15], "ax": 2, "correspond": [2, 3, 4, 6, 12, 13], "For": [2, 11, 12, 14, 15], "fix": [2, 4, 11], "choic": [2, 11], "str0": 2, "last": 2, "each": [2, 3, 4, 6, 7, 11, 13, 14, 15], "str1": 2, "annihil": [2, 15], "pariti": 2, "doubl": [3, 4, 6, 14, 16], "factor": [3, 4, 6, 14, 16], "low": [3, 4, 11], "decomposit": [3, 4, 6], "kappa_": 3, "sum_t": 3, "qi": 3, "altern": [3, 13], "sometim": 3, "yield": [3, 4, 13, 14], "simpler": 3, "frac": 3, "pauli": 3, "obtain": [3, 12, 13, 14], "rewrit": 3, "part": [3, 4], "updat": [3, 13], "appropri": 3, "kappa": 3, "frac18": 3, "asterisk": 3, "summat": 3, "over": 3, "rather": [3, 4, 11], "than": [3, 4, 6, 11, 14], "static": [3, 7], "tol": [3, 4, 7], "1e": [3, 4, 5, 6, 7], "08": [3, 4, 5, 7], "max_vec": [3, 4], "optim": [3, 4, 6, 7, 14], "method": [3, 4, 6, 14], "l": [3, 4, 7, 13, 14], "bfg": [3, 4, 14], "b": [3, 4, 12, 14], "diag_coulomb_mask": [3, 4], "choleski": [3, 4], "decompos": [3, 4, 6, 13], "output": [3, 13, 14], "guarante": 3, "so": [3, 4, 12, 13, 14, 15], "depend": [3, 4, 6, 11], "error": [3, 4], "threshold": [3, 4], "larger": [3, 4, 15], "lead": 3, "smaller": [3, 4, 13, 15], "furthermor": [3, 4], "max_rank": 3, "upper": [3, 4, 6, 14], "bound": [3, 4, 6], "routin": [3, 4, 11, 15], "straightforward": [3, 4], "exact": [3, 4, 11, 13], "nest": [3, 4], "eigenvalu": [3, 4, 6, 12], "addition": [3, 4], "can": [3, 4, 5, 7, 11, 12, 13, 14, 15], "choos": [3, 4, 11, 14], "store": [3, 4, 6, 13, 14], "achiev": [3, 4, 13], "compress": [3, 4], "enabl": [3, 4], "attempt": [3, 4], "minim": [3, 4, 14], "least": [3, 4], "squar": [3, 4, 6, 14], "quantifi": [3, 4], "scipi": [3, 4, 5, 11, 12, 13, 14, 15], "pass": [3, 4, 12, 15], "gradient": [3, 4], "constrain": [3, 4], "certain": [3, 4], "element": [3, 4], "nonzero": [3, 4, 14], "boolean": [3, 4], "triangular": [3, 4], "becaus": [3, 4, 11, 13, 14, 15], "current": 3, "support": [3, 6, 7, 15], "toler": [3, 4, 5, 14], "defin": [3, 4, 14], "absolut": [3, 4, 5, 6], "reconstruct": [3, 4], "limit": [3, 4, 14], "keep": [3, 4], "overrid": [3, 4], "str": [3, 4, 6], "see": [3, 4, 5], "document": [3, 4, 5], "callback": [3, 4], "usag": [3, 4, 15], "dict": [3, 4, 14], "mask": [3, 4], "full": [3, 4, 11], "instead": [3, 4], "much": [3, 4, 11], "more": [3, 4, 11, 14], "expens": [3, 4], "ignor": [3, 4, 13], "1808": [3, 4], "02625": [3, 4], "2104": [3, 4], "08957": [3, 4], "properti": [3, 7, 12], "ell": 4, "pk": 4, "qk": 4, "respect": 4, "too": 4, "small": 4, "exce": 4, "core": 4, "collect": 4, "t2_amplitud": [4, 7], "t_": 4, "ijab": 4, "ap": 4, "ip": 4, "bq": 4, "jq": 4, "v_i": 4, "posit": 4, "definit": 4, "No": 4, "check": [4, 12, 13], "verifi": 4, "1711": 4, "02242": 4, "includ": [4, 7, 11, 12, 13], "assembl": 4, "whose": [4, 5, 11], "target": 4, "slice": 4, "out": [4, 13], "12": [4, 6, 15], "safe": 4, "version": 4, "bla": 4, "nan": 4, "either": [4, 14], "veri": 4, "close": 4, "detect": 4, "up": [4, 5, 12], "case": 4, "behav": 4, "were": 4, "exactli": 4, "contrast": 4, "c": [4, 14], "algebra": [4, 15], "expm": 4, "taylor": 4, "seri": 4, "expans": 4, "pivot": 4, "lu": 4, "rtype": 4, "lower": 4, "unit": 4, "rtol": [4, 5], "05": [4, 5, 14], "atol": [4, 5], "approxim": [4, 5, 13], "rel": [4, 5], "numer": [4, 5, 15], "within": [4, 15], "union": 4, "bool_": 4, "equal": 5, "arg": 5, "kwarg": 5, "compar": [5, 13], "obj": 5, "isclos": 5, "interpret": 5, "ani": [5, 12, 14], "otherwis": [5, 6], "diag": 6, "op": [6, 15], "truncation_threshold": 6, "less": [6, 14], "truncat": [6, 14], "sampling_method": 6, "probabl": 6, "rest": [6, 13], "same": [6, 7, 11, 14], "order": [6, 7, 11, 13, 14, 15], "thei": [6, 12, 14, 15], "norm": 6, "proport": [6, 12], "spectral": 6, "requir": [6, 14], "incoher": 6, "channel": 6, "n_particl": 6, "total": [6, 7, 13, 14], "n_step": [6, 13], "n_sampl": 6, "via": [6, 13], "step": [6, 12, 13], "explicit": 6, "whenev": 6, "complet": 6, "character": 6, "trajectori": 6, "random": [6, 8, 9, 11, 12, 15], "final": [6, 7, 13, 14], "just": [6, 13, 14], "statevector": [6, 11, 12], "largest": 6, "singular": 6, "varianc": 6, "rdm": 6, "suzuki": 6, "formula": 6, "local": [7, 16], "cluster": [7, 16], "jastrow": [7, 16], "ansatz": [7, 16], "ucj": 7, "prod_": [7, 14], "w_k": [7, 14], "_k": [7, 13, 14], "mathbf": [7, 12, 13, 14], "commut": [7, 13, 14], "we": [7, 12, 13, 14, 15], "enforc": [7, 14], "As": [7, 11, 12, 13, 14], "involv": [7, 14], "To": [7, 11, 12, 13, 14], "param": 7, "alpha_alpha_indic": [7, 14], "alpha_beta_indic": [7, 14], "with_final_orbital_rot": 7, "t1_amplitud": 7, "t1": [7, 14], "repetit": [7, 14], "possibli": 7, "packag": [8, 9], "subpackag": [8, 9], "submodul": [8, 9], "modul": [8, 9, 10, 11], "content": [8, 9], "fermion_act": [8, 9], "molecular_data": [8, 9], "test": [8, 9, 12, 13], "wick": [8, 9], "ffsim": [9, 12, 13, 14, 15, 16], "faster": 10, "tutori": [10, 12, 13, 14], "api": 10, "search": 10, "page": 10, "conserv": [11, 15], "compon": [11, 15], "By": 11, "advantag": 11, "symmetri": [11, 12], "effici": [11, 15], "level": [11, 13], "doe": [11, 15], "primari": 11, "wai": [11, 12, 14], "directli": [11, 13], "exampl": [11, 12, 14, 15], "code": [11, 13, 14, 15], "show": [11, 12, 13, 14, 15], "how": [11, 12, 13, 14, 15], "import": [11, 12, 13, 14, 15], "occup": [11, 12, 13], "6": [11, 12, 13, 15], "rang": [11, 12, 13, 14], "1234": [11, 12], "rotated_vec": [11, 12], "plain": 11, "Its": 11, "system": [11, 12], "conveni": 11, "calcul": [11, 13, 14], "comb": 11, "assert": 11, "standard": 11, "often": [11, 14], "simpli": [11, 12], "reshap": 11, "reshaped_vec": 11, "pyscf": [11, 13, 14], "fundament": 12, "mode": 12, "sum_j": 12, "That": [12, 15], "satisfi": [12, 15], "anticommut": 12, "relat": [12, 14], "align": [12, 14], "_1": 12, "_2": 12, "section": 12, "ll": [12, 13, 14], "demonstr": [12, 13, 14], "task": 12, "consid": [12, 14], "rewritten": 12, "introduc": [12, 14], "eigendecomposit": 12, "sum_k": [12, 13], "lambda_k": 12, "ik": 12, "jk": 12, "our": [12, 13, 14], "ground": [12, 14], "pick": 12, "phase": 12, "energi": [12, 13, 14], "spars": [12, 13, 15], "lowest": [12, 13], "eigenvector": 12, "eig": [12, 15], "eigsh": 12, "la": 12, "fact": 12, "you": 12, "illustr": 12, "purpos": 12, "explicitli": 12, "eigh": [12, 13], "evolved_vec": 12, "conj": 12, "undo": 12, "expected_phas": 12, "1j": [12, 13, 15], "assert_allclos": 12, "mention": [12, 13], "abov": [12, 13, 15], "below": [12, 13, 14], "better": [12, 13], "4": [12, 13, 14, 15], "evolved_vec_alt": 12, "daunt": 13, "scale": 13, "cell": [13, 14], "hydrogen": 13, "molecul": [13, 14], "stretch": [13, 14], "bond": [13, 14], "build": [13, 14], "h2": 13, "mol": [13, 14], "gto": [13, 14], "mole": [13, 14], "atom": [13, 14], "8": [13, 14, 15], "sto": [13, 14], "6g": [13, 14], "hartree_fock": [13, 14], "scf": [13, 14], "rhf": [13, 14], "kernel": [13, 14], "mol_data": [13, 14], "from_hartree_fock": [13, 14], "mol_hamiltonian": [13, 14], "df_hamiltonian": 13, "converg": [13, 14], "837796382593709": 13, "dataclass": [13, 14], "print": [13, 14, 15], "some": [13, 15], "inform": [13, 15], "One": 13, "27478830e": 13, "01": [13, 14], "66405155e": 13, "16": 13, "07220771e": 13, "77238770e": 13, "5": [13, 14, 15], "23173938e": 13, "57437591e": 13, "33545754e": 13, "12704463e": 13, "48240570e": 13, "61492903e": 13, "24884750e": 13, "53132024e": 13, "21318608e": 13, "00": [13, 14], "25870402e": 13, "76015378e": 13, "07792507e": 13, "14653029e": 13, "50800163e": 13, "59": 13, "58462611e": 13, "31": 13, "52090881e": 13, "03": 13, "00000000e": 13, "24520980e": 13, "15": 13, "7": [13, 15], "07106781e": 13, "48603030e": 13, "although": 13, "alreadi": 13, "built": 13, "manual": 13, "asymmetr": 13, "h_k": 13, "divid": 13, "singl": 13, "exponenti": 13, "individu": [13, 15], "do": [13, 15], "approx": 13, "prod_k": 13, "higher": 13, "deriv": 13, "write": 13, "recal": 13, "addit": [13, 15], "think": 13, "compos": 13, "quadrat": [13, 16], "def": [13, 14], "simulate_trotter_step_double_factor": 13, "one_body_energi": 13, "one_body_basis_chang": 13, "zip": 13, "finish": 13, "handl": 13, "split": 13, "multipl": [13, 15], "wrote": 13, "step_tim": 13, "hartre": [13, 14], "fock": [13, 14], "match": 13, "initial_st": 13, "\u03c8": [13, 14], "hf_energi": 13, "vdot": [13, 14], "f": [13, 14], "8377963825937088": 13, "now": 13, "later": 13, "exact_st": 13, "expm_multipli": 13, "tracea": 13, "fidel": 13, "ab": 13, "9696296369955066": 13, "final_st": [13, 14], "999027574408349": 13, "improv": 13, "increas": 13, "10": 13, "9999906233109657": 13, "commonli": 13, "known": 13, "fourth": 13, "reproduc": 13, "9": [13, 14, 15], "fewer": 13, "9999999336740057": 13, "ethen": 14, "mcscf": 14, "bond_dist": 14, "678": 14, "5626": 14, "9289": 14, "activ": 14, "active_spac": 14, "nelectron": 14, "ca": 14, "casci": 14, "nca": 14, "neleca": 14, "mo": 14, "sort_mo": 14, "energy_fci": 14, "77": 14, "4456267643962": 14, "6290254326717": 14, "ci": 14, "57322412553862": 14, "0000000": 14, "phi_0": 14, "taken": 14, "express": 14, "previou": 14, "constructor": 14, "provid": 14, "ccsd": 14, "mp2": 14, "run": 14, "cc": 14, "frozen": 14, "mo_coeff": 14, "reference_st": 14, "ansatz_st": 14, "initiali": 14, "49387212754473": 14, "e_corr": 14, "04824536314851328": 14, "46975600021656": 14, "facilit": 14, "convers": 14, "precis": 14, "somewhat": 14, "complic": 14, "short": 14, "entri": 14, "non": 14, "redund": 14, "associ": [14, 15], "fun": 14, "x0": 14, "maxfun": 14, "50000": 14, "len": 14, "72": 14, "messag": 14, "rel_reduction_of_f_": 14, "lt": 14, "_factr": 14, "epsmch": 14, "success": 14, "statu": 14, "62901334909452": 14, "597e": 14, "974e": 14, "896e": 14, "161e": 14, "nit": 14, "403": 14, "jac": 14, "521e": 14, "245e": 14, "04": 14, "236e": 14, "150e": 14, "nfev": 14, "31682": 14, "njev": 14, "434": 14, "hess_inv": 14, "72x72": 14, "lbfgsinvhessproduct": 14, "float64": 14, "gt": 14, "connect": 14, "swap": 14, "network": 14, "make": 14, "challeng": 14, "noisi": 14, "pre": 14, "fault": 14, "processor": 14, "idea": 14, "impos": 14, "sparsiti": 14, "constraint": 14, "them": 14, "depth": 14, "topologi": 14, "triangl": 14, "sinc": 14, "need": 14, "lattic": 14, "parallel": 14, "line": 14, "rung": 14, "ladder": 14, "With": 14, "setup": 14, "while": 14, "share": 14, "ldot": 14, "without": 14, "Of": 14, "cours": 14, "notic": 14, "decreas": 14, "46": 14, "62873223663462": 14, "942e": 14, "888e": 14, "479e": 14, "915e": 14, "02": 14, "285": 14, "563e": 14, "695e": 14, "279e": 14, "776e": 14, "14335": 14, "305": 14, "46x46": 14, "25": 15, "Such": 15, "programmat": 15, "dictionari": 15, "hash": 15, "tabl": 15, "piec": 15, "being": 15, "upon": 15, "intern": 15, "itself": 15, "recommend": 15, "helper": 15, "shown": 15, "op1": 15, "repr": 15, "view": 15, "displai": 15, "39": 15, "0j": 15, "arithmet": 15, "multipli": 15, "scalar": 15, "go": 15, "op2": 15, "op3": 15, "0625": 15, "5j": 15, "25j": 15, "125": 15, "2j": 15, "good": 15, "awar": 15, "especi": 15, "avoid": 15, "These": 15, "subtract": 15, "divis": 15, "6j": 15, "4j": 15, "12j": 15, "3j": 15, "normal": 15, "normal_ord": 15, "compris": 15, "appear": 15, "descend": 15, "lexicograph": 15, "preserv": 15, "far": 15, "criteria": 15, "conserves_particle_numb": 15, "conserves_spin_z": 15, "subspac": 15, "op4": 15, "linop": 15, "onto": 15, "14601055": 15, "2517831j": 15, "most": 15, "lm": 15, "21984743e": 15, "18j": 15, "introduct": 16, "fermionoper": 16}, "objects": {"": [[0, 0, 0, "-", "ffsim"]], "ffsim": [[1, 0, 0, "-", "contract"], [0, 0, 0, "-", "fermion_action"], [2, 0, 0, "-", "gates"], [3, 0, 0, "-", "hamiltonians"], [4, 0, 0, "-", "linalg"], [0, 0, 0, "-", "molecular_data"], [5, 0, 0, "-", "protocols"], [0, 0, 0, "-", "random"], [0, 0, 0, "-", "states"], [0, 0, 0, "-", "testing"], [6, 0, 0, "-", "trotter"], [7, 0, 0, "-", "variational"], [0, 0, 0, "-", "wick"]], "ffsim.contract": [[1, 0, 0, "-", "diag_coulomb"], [1, 0, 0, "-", "hamiltonian"], [1, 0, 0, "-", "num_op_sum"]], "ffsim.contract.diag_coulomb": [[1, 1, 1, "", "contract_diag_coulomb"], [1, 1, 1, "", "diag_coulomb_linop"]], "ffsim.contract.hamiltonian": [[1, 1, 1, "", "hamiltonian_linop"], [1, 1, 1, "", "hamiltonian_trace"]], "ffsim.contract.num_op_sum": [[1, 1, 1, "", "contract_num_op_sum"], [1, 1, 1, "", "num_op_sum_linop"]], "ffsim.fermion_action": [[0, 2, 1, "", "FermionAction"], [0, 1, 1, "", "cre"], [0, 1, 1, "", "cre_a"], [0, 1, 1, "", "cre_b"], [0, 1, 1, "", "des"], [0, 1, 1, "", "des_a"], [0, 1, 1, "", "des_b"]], "ffsim.fermion_action.FermionAction": [[0, 3, 1, "", "action"], [0, 3, 1, "", "orb"], [0, 3, 1, "", "spin"]], "ffsim.gates": [[2, 0, 0, "-", "basic_gates"], [2, 0, 0, "-", "diag_coulomb"], [2, 0, 0, "-", "num_op_sum"], [2, 0, 0, "-", "orbital_rotation"]], "ffsim.gates.basic_gates": [[2, 1, 1, "", "apply_fsim_gate"], [2, 1, 1, "", "apply_givens_rotation"], [2, 1, 1, "", "apply_hop_gate"], [2, 1, 1, "", "apply_num_interaction"], [2, 1, 1, "", "apply_num_num_interaction"], [2, 1, 1, "", "apply_num_op_prod_interaction"], [2, 1, 1, "", "apply_tunneling_interaction"]], "ffsim.gates.diag_coulomb": [[2, 1, 1, "", "apply_diag_coulomb_evolution"]], "ffsim.gates.num_op_sum": [[2, 1, 1, "", "apply_num_op_sum_evolution"]], "ffsim.gates.orbital_rotation": [[2, 1, 1, "", "apply_orbital_rotation"], [2, 1, 1, "", "gen_orbital_rotation_index"]], "ffsim.hamiltonians": [[3, 0, 0, "-", "double_factorized_hamiltonian"], [3, 0, 0, "-", "molecular_hamiltonian"]], "ffsim.hamiltonians.double_factorized_hamiltonian": [[3, 2, 1, "", "DoubleFactorizedHamiltonian"]], "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian": [[3, 3, 1, "", "constant"], [3, 3, 1, "", "diag_coulomb_mats"], [3, 4, 1, "", "from_molecular_hamiltonian"], [3, 5, 1, "", "norb"], [3, 3, 1, "", "one_body_tensor"], [3, 3, 1, "", "orbital_rotations"], [3, 4, 1, "", "to_number_representation"], [3, 4, 1, "", "to_z_representation"], [3, 3, 1, "", "z_representation"]], "ffsim.hamiltonians.molecular_hamiltonian": [[3, 2, 1, "", "MolecularHamiltonian"]], "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian": [[3, 3, 1, "", "constant"], [3, 5, 1, "", "norb"], [3, 3, 1, "", "one_body_tensor"], [3, 3, 1, "", "two_body_tensor"]], "ffsim.linalg": [[4, 0, 0, "-", "double_factorized"], [4, 0, 0, "-", "givens"], [4, 0, 0, "-", "linalg"], [4, 0, 0, "-", "predicates"]], "ffsim.linalg.double_factorized": [[4, 1, 1, "", "double_factorized"], [4, 1, 1, "", "double_factorized_t2"], [4, 1, 1, "", "modified_cholesky"], [4, 1, 1, "", "optimal_diag_coulomb_mats"]], "ffsim.linalg.givens": [[4, 1, 1, "", "apply_matrix_to_slices"], [4, 1, 1, "", "givens_decomposition"], [4, 1, 1, "", "zrotg"]], "ffsim.linalg.linalg": [[4, 1, 1, "", "expm_multiply_taylor"], [4, 1, 1, "", "lup"]], "ffsim.linalg.predicates": [[4, 1, 1, "", "is_antihermitian"], [4, 1, 1, "", "is_hermitian"], [4, 1, 1, "", "is_orthogonal"], [4, 1, 1, "", "is_real_symmetric"], [4, 1, 1, "", "is_special_orthogonal"], [4, 1, 1, "", "is_unitary"]], "ffsim.molecular_data": [[0, 2, 1, "", "MolecularData"]], "ffsim.protocols": [[5, 0, 0, "-", "approximate_equality"], [5, 0, 0, "-", "linear_operator"], [5, 0, 0, "-", "trace"]], "ffsim.protocols.approximate_equality": [[5, 2, 1, "", "SupportsApproximateEquality"], [5, 1, 1, "", "approx_eq"]], "ffsim.protocols.linear_operator": [[5, 2, 1, "", "SupportsLinearOperator"], [5, 1, 1, "", "linear_operator"]], "ffsim.protocols.trace": [[5, 2, 1, "", "SupportsTrace"], [5, 1, 1, "", "trace"]], "ffsim.random": [[0, 1, 1, "", "random_antihermitian"], [0, 1, 1, "", "random_hermitian"], [0, 1, 1, "", "random_orthogonal"], [0, 1, 1, "", "random_real_symmetric_matrix"], [0, 1, 1, "", "random_special_orthogonal"], [0, 1, 1, "", "random_statevector"], [0, 1, 1, "", "random_t2_amplitudes"], [0, 1, 1, "", "random_two_body_tensor_real"], [0, 1, 1, "", "random_unitary"]], "ffsim.states": [[0, 1, 1, "", "dim"], [0, 1, 1, "", "dims"], [0, 1, 1, "", "one_hot"], [0, 1, 1, "", "slater_determinant"], [0, 1, 1, "", "slater_determinant_one_rdm"]], "ffsim.testing": [[0, 1, 1, "", "random_nelec"], [0, 1, 1, "", "random_occupied_orbitals"]], "ffsim.trotter": [[6, 0, 0, "-", "qdrift"], [6, 0, 0, "-", "trotter"]], "ffsim.trotter.qdrift": [[6, 1, 1, "", "expectation_squared_diag_coulomb"], [6, 1, 1, "", "one_body_square_decomposition"], [6, 1, 1, "", "qdrift_probabilities"], [6, 1, 1, "", "simulate_qdrift_double_factorized"], [6, 1, 1, "", "spectral_norm_diag_coulomb"], [6, 1, 1, "", "spectral_norm_one_body_tensor"], [6, 1, 1, "", "variance_diag_coulomb"], [6, 1, 1, "", "variance_one_body_tensor"]], "ffsim.trotter.trotter": [[6, 1, 1, "", "simulate_trotter_double_factorized"]], "ffsim.variational": [[7, 0, 0, "-", "lucj"]], "ffsim.variational.lucj": [[7, 2, 1, "", "UCJOperator"], [7, 1, 1, "", "apply_ucj_operator"]], "ffsim.variational.lucj.UCJOperator": [[7, 3, 1, "", "diag_coulomb_mats_alpha_alpha"], [7, 3, 1, "", "diag_coulomb_mats_alpha_beta"], [7, 3, 1, "", "final_orbital_rotation"], [7, 4, 1, "", "from_parameters"], [7, 4, 1, "", "from_t_amplitudes"], [7, 5, 1, "", "n_reps"], [7, 5, 1, "", "norb"], [7, 3, 1, "", "orbital_rotations"], [7, 4, 1, "", "to_parameters"], [7, 4, 1, "", "to_t_amplitudes"]], "ffsim.wick": [[0, 1, 1, "", "expectation_power"], [0, 1, 1, "", "expectation_product"]]}, "objtypes": {"0": "py:module", "1": "py:function", "2": "py:class", "3": "py:attribute", "4": "py:method", "5": "py:property"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"], "2": ["py", "class", "Python class"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "method", "Python method"], "5": ["py", "property", "Python property"]}, "titleterms": {"ffsim": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11], "packag": [0, 1, 2, 3, 4, 5, 6, 7], "subpackag": 0, "submodul": [0, 1, 2, 3, 4, 5, 6, 7], "fermion_act": 0, "modul": [0, 1, 2, 3, 4, 5, 6, 7], "molecular_data": 0, "random": 0, "state": 0, "test": 0, "wick": 0, "content": [0, 1, 2, 3, 4, 5, 6, 7, 10, 16], "contract": 1, "diag_coulomb": [1, 2], "hamiltonian": [1, 3, 12, 13], "num_op_sum": [1, 2], "gate": 2, "basic_g": 2, "orbital_rot": 2, "double_factorized_hamiltonian": 3, "molecular_hamiltonian": 3, "linalg": 4, "double_factor": 4, "given": 4, "predic": 4, "protocol": 5, "approximate_equ": 5, "linear_oper": 5, "trace": 5, "trotter": [6, 13], "qdrift": 6, "variat": 7, "lucj": [7, 14], "api": 9, "refer": 9, "document": 10, "indic": 10, "tabl": 10, "introduct": 11, "orbit": 12, "rotat": 12, "quadrat": 12, "time": 12, "evolut": 12, "diagon": 13, "coulomb": 13, "oper": 13, "doubl": 13, "factor": 13, "simul": 13, "represent": 13, "molecular": 13, "brief": 13, "background": 13, "suzuki": 13, "formula": 13, "implement": 13, "The": [14, 15], "local": 14, "unitari": 14, "cluster": 14, "jastrow": 14, "ansatz": 14, "ucj": 14, "fermionoper": 15, "class": 15, "tutori": 16}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "nbsphinx": 4, "sphinx": 60}, "alltitles": {"ffsim package": [[0, "ffsim-package"]], "Subpackages": [[0, "subpackages"]], "Submodules": [[0, "submodules"], [1, "submodules"], [2, "submodules"], [3, "submodules"], [4, "submodules"], [5, "submodules"], [6, "submodules"], [7, "submodules"]], "ffsim.fermion_action module": [[0, "module-ffsim.fermion_action"]], "ffsim.molecular_data module": [[0, "module-ffsim.molecular_data"]], "ffsim.random module": [[0, "module-ffsim.random"]], "ffsim.states module": [[0, "module-ffsim.states"]], "ffsim.testing module": [[0, "module-ffsim.testing"]], "ffsim.wick module": [[0, "module-ffsim.wick"]], "Module contents": [[0, "module-ffsim"], [1, "module-ffsim.contract"], [2, "module-ffsim.gates"], [3, "module-ffsim.hamiltonians"], [4, "module-ffsim.linalg"], [5, "module-ffsim.protocols"], [6, "module-ffsim.trotter"], [7, "module-ffsim.variational"]], "ffsim.contract package": [[1, "ffsim-contract-package"]], "ffsim.contract.diag_coulomb module": [[1, "module-ffsim.contract.diag_coulomb"]], "ffsim.contract.hamiltonian module": [[1, "module-ffsim.contract.hamiltonian"]], "ffsim.contract.num_op_sum module": [[1, "module-ffsim.contract.num_op_sum"]], "ffsim.gates package": [[2, "ffsim-gates-package"]], "ffsim.gates.basic_gates module": [[2, "module-ffsim.gates.basic_gates"]], "ffsim.gates.diag_coulomb module": [[2, "module-ffsim.gates.diag_coulomb"]], "ffsim.gates.num_op_sum module": [[2, "module-ffsim.gates.num_op_sum"]], "ffsim.gates.orbital_rotation module": [[2, "module-ffsim.gates.orbital_rotation"]], "ffsim.hamiltonians package": [[3, "ffsim-hamiltonians-package"]], "ffsim.hamiltonians.double_factorized_hamiltonian module": [[3, "module-ffsim.hamiltonians.double_factorized_hamiltonian"]], "ffsim.hamiltonians.molecular_hamiltonian module": [[3, "module-ffsim.hamiltonians.molecular_hamiltonian"]], "ffsim.linalg package": [[4, "ffsim-linalg-package"]], "ffsim.linalg.double_factorized module": [[4, "module-ffsim.linalg.double_factorized"]], "ffsim.linalg.givens module": [[4, "module-ffsim.linalg.givens"]], "ffsim.linalg.linalg module": [[4, "module-ffsim.linalg.linalg"]], "ffsim.linalg.predicates module": [[4, "module-ffsim.linalg.predicates"]], "ffsim.protocols package": [[5, "ffsim-protocols-package"]], "ffsim.protocols.approximate_equality module": [[5, "module-ffsim.protocols.approximate_equality"]], "ffsim.protocols.linear_operator module": [[5, "module-ffsim.protocols.linear_operator"]], "ffsim.protocols.trace module": [[5, "module-ffsim.protocols.trace"]], "ffsim.trotter package": [[6, "ffsim-trotter-package"]], "ffsim.trotter.qdrift module": [[6, "module-ffsim.trotter.qdrift"]], "ffsim.trotter.trotter module": [[6, "module-ffsim.trotter.trotter"]], "ffsim.variational package": [[7, "ffsim-variational-package"]], "ffsim.variational.lucj module": [[7, "module-ffsim.variational.lucj"]], "ffsim": [[8, "ffsim"]], "API reference": [[9, "api-reference"]], "ffsim documentation": [[10, "ffsim-documentation"]], "Contents:": [[10, null], [16, null]], "Indices and tables": [[10, "indices-and-tables"]], "Introduction to ffsim": [[11, "Introduction-to-ffsim"]], "Orbital rotations and quadratic Hamiltonians": [[12, "Orbital-rotations-and-quadratic-Hamiltonians"]], "Orbital rotations": [[12, "Orbital-rotations"]], "Time evolution by a quadratic Hamiltonian": [[12, "Time-evolution-by-a-quadratic-Hamiltonian"]], "Diagonal Coulomb operators and double-factorized Trotter simulation": [[13, "Diagonal-Coulomb-operators-and-double-factorized-Trotter-simulation"]], "Double-factorized representation of the molecular Hamiltonian": [[13, "Double-factorized-representation-of-the-molecular-Hamiltonian"]], "Trotter simulation of the double-factorized Hamiltonian": [[13, "Trotter-simulation-of-the-double-factorized-Hamiltonian"]], "Brief background on Trotter-Suzuki formulas": [[13, "Brief-background-on-Trotter-Suzuki-formulas"]], "Implementing Trotter simulation of the double-factorized Hamiltonian": [[13, "Implementing-Trotter-simulation-of-the-double-factorized-Hamiltonian"]], "The local unitary cluster Jastrow (LUCJ) ansatz": [[14, "The-local-unitary-cluster-Jastrow-(LUCJ)-ansatz"], [14, "id1"]], "The unitary cluster Jastrow (UCJ) ansatz": [[14, "The-unitary-cluster-Jastrow-(UCJ)-ansatz"]], "The FermionOperator class": [[15, "The-FermionOperator-class"]], "Tutorials": [[16, "tutorials"]]}, "indexentries": {"fermionaction (class in ffsim.fermion_action)": [[0, "ffsim.fermion_action.FermionAction"]], "moleculardata (class in ffsim.molecular_data)": [[0, "ffsim.molecular_data.MolecularData"]], "action (ffsim.fermion_action.fermionaction attribute)": [[0, "ffsim.fermion_action.FermionAction.action"]], "cre() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.cre"]], "cre_a() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.cre_a"]], "cre_b() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.cre_b"]], "des() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.des"]], "des_a() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.des_a"]], "des_b() (in module ffsim.fermion_action)": [[0, "ffsim.fermion_action.des_b"]], "dim() (in module ffsim.states)": [[0, "ffsim.states.dim"]], "dims() (in module ffsim.states)": [[0, "ffsim.states.dims"]], "expectation_power() (in module ffsim.wick)": [[0, "ffsim.wick.expectation_power"]], "expectation_product() (in module ffsim.wick)": [[0, "ffsim.wick.expectation_product"]], "ffsim": [[0, "module-ffsim"]], "ffsim.fermion_action": [[0, "module-ffsim.fermion_action"]], "ffsim.molecular_data": [[0, "module-ffsim.molecular_data"]], "ffsim.random": [[0, "module-ffsim.random"]], "ffsim.states": [[0, "module-ffsim.states"]], "ffsim.testing": [[0, "module-ffsim.testing"]], "ffsim.wick": [[0, "module-ffsim.wick"]], "module": [[0, "module-ffsim"], [0, "module-ffsim.fermion_action"], [0, "module-ffsim.molecular_data"], [0, "module-ffsim.random"], [0, "module-ffsim.states"], [0, "module-ffsim.testing"], [0, "module-ffsim.wick"], [1, "module-ffsim.contract"], [1, "module-ffsim.contract.diag_coulomb"], [1, "module-ffsim.contract.hamiltonian"], [1, "module-ffsim.contract.num_op_sum"], [2, "module-ffsim.gates"], [2, "module-ffsim.gates.basic_gates"], [2, "module-ffsim.gates.diag_coulomb"], [2, "module-ffsim.gates.num_op_sum"], [2, "module-ffsim.gates.orbital_rotation"], [3, "module-ffsim.hamiltonians"], [3, "module-ffsim.hamiltonians.double_factorized_hamiltonian"], [3, "module-ffsim.hamiltonians.molecular_hamiltonian"], [4, "module-ffsim.linalg"], [4, "module-ffsim.linalg.double_factorized"], [4, "module-ffsim.linalg.givens"], [4, "module-ffsim.linalg.linalg"], [4, "module-ffsim.linalg.predicates"], [5, "module-ffsim.protocols"], [5, "module-ffsim.protocols.approximate_equality"], [5, "module-ffsim.protocols.linear_operator"], [5, "module-ffsim.protocols.trace"], [6, "module-ffsim.trotter"], [6, "module-ffsim.trotter.qdrift"], [6, "module-ffsim.trotter.trotter"], [7, "module-ffsim.variational"], [7, "module-ffsim.variational.lucj"]], "one_hot() (in module ffsim.states)": [[0, "ffsim.states.one_hot"]], "orb (ffsim.fermion_action.fermionaction attribute)": [[0, "ffsim.fermion_action.FermionAction.orb"]], "random_antihermitian() (in module ffsim.random)": [[0, "ffsim.random.random_antihermitian"]], "random_hermitian() (in module ffsim.random)": [[0, "ffsim.random.random_hermitian"]], "random_nelec() (in module ffsim.testing)": [[0, "ffsim.testing.random_nelec"]], "random_occupied_orbitals() (in module ffsim.testing)": [[0, "ffsim.testing.random_occupied_orbitals"]], "random_orthogonal() (in module ffsim.random)": [[0, "ffsim.random.random_orthogonal"]], "random_real_symmetric_matrix() (in module ffsim.random)": [[0, "ffsim.random.random_real_symmetric_matrix"]], "random_special_orthogonal() (in module ffsim.random)": [[0, "ffsim.random.random_special_orthogonal"]], "random_statevector() (in module ffsim.random)": [[0, "ffsim.random.random_statevector"]], "random_t2_amplitudes() (in module ffsim.random)": [[0, "ffsim.random.random_t2_amplitudes"]], "random_two_body_tensor_real() (in module ffsim.random)": [[0, "ffsim.random.random_two_body_tensor_real"]], "random_unitary() (in module ffsim.random)": [[0, "ffsim.random.random_unitary"]], "slater_determinant() (in module ffsim.states)": [[0, "ffsim.states.slater_determinant"]], "slater_determinant_one_rdm() (in module ffsim.states)": [[0, "ffsim.states.slater_determinant_one_rdm"]], "spin (ffsim.fermion_action.fermionaction attribute)": [[0, "ffsim.fermion_action.FermionAction.spin"]], "contract_diag_coulomb() (in module ffsim.contract.diag_coulomb)": [[1, "ffsim.contract.diag_coulomb.contract_diag_coulomb"]], "contract_num_op_sum() (in module ffsim.contract.num_op_sum)": [[1, "ffsim.contract.num_op_sum.contract_num_op_sum"]], "diag_coulomb_linop() (in module ffsim.contract.diag_coulomb)": [[1, "ffsim.contract.diag_coulomb.diag_coulomb_linop"]], "ffsim.contract": [[1, "module-ffsim.contract"]], "ffsim.contract.diag_coulomb": [[1, "module-ffsim.contract.diag_coulomb"]], "ffsim.contract.hamiltonian": [[1, "module-ffsim.contract.hamiltonian"]], "ffsim.contract.num_op_sum": [[1, "module-ffsim.contract.num_op_sum"]], "hamiltonian_linop() (in module ffsim.contract.hamiltonian)": [[1, "ffsim.contract.hamiltonian.hamiltonian_linop"]], "hamiltonian_trace() (in module ffsim.contract.hamiltonian)": [[1, "ffsim.contract.hamiltonian.hamiltonian_trace"]], "num_op_sum_linop() (in module ffsim.contract.num_op_sum)": [[1, "ffsim.contract.num_op_sum.num_op_sum_linop"]], "apply_diag_coulomb_evolution() (in module ffsim.gates.diag_coulomb)": [[2, "ffsim.gates.diag_coulomb.apply_diag_coulomb_evolution"]], "apply_fsim_gate() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_fsim_gate"]], "apply_givens_rotation() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_givens_rotation"]], "apply_hop_gate() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_hop_gate"]], "apply_num_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_num_interaction"]], "apply_num_num_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_num_num_interaction"]], "apply_num_op_prod_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_num_op_prod_interaction"]], "apply_num_op_sum_evolution() (in module ffsim.gates.num_op_sum)": [[2, "ffsim.gates.num_op_sum.apply_num_op_sum_evolution"]], "apply_orbital_rotation() (in module ffsim.gates.orbital_rotation)": [[2, "ffsim.gates.orbital_rotation.apply_orbital_rotation"]], "apply_tunneling_interaction() (in module ffsim.gates.basic_gates)": [[2, "ffsim.gates.basic_gates.apply_tunneling_interaction"]], "ffsim.gates": [[2, "module-ffsim.gates"]], "ffsim.gates.basic_gates": [[2, "module-ffsim.gates.basic_gates"]], "ffsim.gates.diag_coulomb": [[2, "module-ffsim.gates.diag_coulomb"]], "ffsim.gates.num_op_sum": [[2, "module-ffsim.gates.num_op_sum"]], "ffsim.gates.orbital_rotation": [[2, "module-ffsim.gates.orbital_rotation"]], "gen_orbital_rotation_index() (in module ffsim.gates.orbital_rotation)": [[2, "ffsim.gates.orbital_rotation.gen_orbital_rotation_index"]], "doublefactorizedhamiltonian (class in ffsim.hamiltonians.double_factorized_hamiltonian)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian"]], "molecularhamiltonian (class in ffsim.hamiltonians.molecular_hamiltonian)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian"]], "constant (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.constant"]], "constant (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian attribute)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.constant"]], "diag_coulomb_mats (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.diag_coulomb_mats"]], "ffsim.hamiltonians": [[3, "module-ffsim.hamiltonians"]], "ffsim.hamiltonians.double_factorized_hamiltonian": [[3, "module-ffsim.hamiltonians.double_factorized_hamiltonian"]], "ffsim.hamiltonians.molecular_hamiltonian": [[3, "module-ffsim.hamiltonians.molecular_hamiltonian"]], "from_molecular_hamiltonian() (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian static method)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.from_molecular_hamiltonian"]], "norb (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian property)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.norb"]], "norb (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian property)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.norb"]], "one_body_tensor (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.one_body_tensor"]], "one_body_tensor (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian attribute)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.one_body_tensor"]], "orbital_rotations (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.orbital_rotations"]], "to_number_representation() (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian method)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.to_number_representation"]], "to_z_representation() (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian method)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.to_z_representation"]], "two_body_tensor (ffsim.hamiltonians.molecular_hamiltonian.molecularhamiltonian attribute)": [[3, "ffsim.hamiltonians.molecular_hamiltonian.MolecularHamiltonian.two_body_tensor"]], "z_representation (ffsim.hamiltonians.double_factorized_hamiltonian.doublefactorizedhamiltonian attribute)": [[3, "ffsim.hamiltonians.double_factorized_hamiltonian.DoubleFactorizedHamiltonian.z_representation"]], "apply_matrix_to_slices() (in module ffsim.linalg.givens)": [[4, "ffsim.linalg.givens.apply_matrix_to_slices"]], "double_factorized() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.double_factorized"]], "double_factorized_t2() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.double_factorized_t2"]], "expm_multiply_taylor() (in module ffsim.linalg.linalg)": [[4, "ffsim.linalg.linalg.expm_multiply_taylor"]], "ffsim.linalg": [[4, "module-ffsim.linalg"]], "ffsim.linalg.double_factorized": [[4, "module-ffsim.linalg.double_factorized"]], "ffsim.linalg.givens": [[4, "module-ffsim.linalg.givens"]], "ffsim.linalg.linalg": [[4, "module-ffsim.linalg.linalg"]], "ffsim.linalg.predicates": [[4, "module-ffsim.linalg.predicates"]], "givens_decomposition() (in module ffsim.linalg.givens)": [[4, "ffsim.linalg.givens.givens_decomposition"]], "is_antihermitian() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_antihermitian"]], "is_hermitian() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_hermitian"]], "is_orthogonal() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_orthogonal"]], "is_real_symmetric() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_real_symmetric"]], "is_special_orthogonal() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_special_orthogonal"]], "is_unitary() (in module ffsim.linalg.predicates)": [[4, "ffsim.linalg.predicates.is_unitary"]], "lup() (in module ffsim.linalg.linalg)": [[4, "ffsim.linalg.linalg.lup"]], "modified_cholesky() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.modified_cholesky"]], "optimal_diag_coulomb_mats() (in module ffsim.linalg.double_factorized)": [[4, "ffsim.linalg.double_factorized.optimal_diag_coulomb_mats"]], "zrotg() (in module ffsim.linalg.givens)": [[4, "ffsim.linalg.givens.zrotg"]], "supportsapproximateequality (class in ffsim.protocols.approximate_equality)": [[5, "ffsim.protocols.approximate_equality.SupportsApproximateEquality"]], "supportslinearoperator (class in ffsim.protocols.linear_operator)": [[5, "ffsim.protocols.linear_operator.SupportsLinearOperator"]], "supportstrace (class in ffsim.protocols.trace)": [[5, "ffsim.protocols.trace.SupportsTrace"]], "approx_eq() (in module ffsim.protocols.approximate_equality)": [[5, "ffsim.protocols.approximate_equality.approx_eq"]], "ffsim.protocols": [[5, "module-ffsim.protocols"]], "ffsim.protocols.approximate_equality": [[5, "module-ffsim.protocols.approximate_equality"]], "ffsim.protocols.linear_operator": [[5, "module-ffsim.protocols.linear_operator"]], "ffsim.protocols.trace": [[5, "module-ffsim.protocols.trace"]], "linear_operator() (in module ffsim.protocols.linear_operator)": [[5, "ffsim.protocols.linear_operator.linear_operator"]], "trace() (in module ffsim.protocols.trace)": [[5, "ffsim.protocols.trace.trace"]], "expectation_squared_diag_coulomb() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.expectation_squared_diag_coulomb"]], "ffsim.trotter": [[6, "module-ffsim.trotter"]], "ffsim.trotter.qdrift": [[6, "module-ffsim.trotter.qdrift"]], "ffsim.trotter.trotter": [[6, "module-ffsim.trotter.trotter"]], "one_body_square_decomposition() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.one_body_square_decomposition"]], "qdrift_probabilities() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.qdrift_probabilities"]], "simulate_qdrift_double_factorized() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.simulate_qdrift_double_factorized"]], "simulate_trotter_double_factorized() (in module ffsim.trotter.trotter)": [[6, "ffsim.trotter.trotter.simulate_trotter_double_factorized"]], "spectral_norm_diag_coulomb() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.spectral_norm_diag_coulomb"]], "spectral_norm_one_body_tensor() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.spectral_norm_one_body_tensor"]], "variance_diag_coulomb() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.variance_diag_coulomb"]], "variance_one_body_tensor() (in module ffsim.trotter.qdrift)": [[6, "ffsim.trotter.qdrift.variance_one_body_tensor"]], "ucjoperator (class in ffsim.variational.lucj)": [[7, "ffsim.variational.lucj.UCJOperator"]], "apply_ucj_operator() (in module ffsim.variational.lucj)": [[7, "ffsim.variational.lucj.apply_ucj_operator"]], "diag_coulomb_mats_alpha_alpha (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.diag_coulomb_mats_alpha_alpha"]], "diag_coulomb_mats_alpha_beta (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.diag_coulomb_mats_alpha_beta"]], "ffsim.variational": [[7, "module-ffsim.variational"]], "ffsim.variational.lucj": [[7, "module-ffsim.variational.lucj"]], "final_orbital_rotation (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.final_orbital_rotation"]], "from_parameters() (ffsim.variational.lucj.ucjoperator static method)": [[7, "ffsim.variational.lucj.UCJOperator.from_parameters"]], "from_t_amplitudes() (ffsim.variational.lucj.ucjoperator static method)": [[7, "ffsim.variational.lucj.UCJOperator.from_t_amplitudes"]], "n_reps (ffsim.variational.lucj.ucjoperator property)": [[7, "ffsim.variational.lucj.UCJOperator.n_reps"]], "norb (ffsim.variational.lucj.ucjoperator property)": [[7, "ffsim.variational.lucj.UCJOperator.norb"]], "orbital_rotations (ffsim.variational.lucj.ucjoperator attribute)": [[7, "ffsim.variational.lucj.UCJOperator.orbital_rotations"]], "to_parameters() (ffsim.variational.lucj.ucjoperator method)": [[7, "ffsim.variational.lucj.UCJOperator.to_parameters"]], "to_t_amplitudes() (ffsim.variational.lucj.ucjoperator method)": [[7, "ffsim.variational.lucj.UCJOperator.to_t_amplitudes"]]}}) \ No newline at end of file diff --git a/tutorials/01-introduction.ipynb b/tutorials/01-introduction.ipynb index b46f68b04..9ba68d884 100644 --- a/tutorials/01-introduction.ipynb +++ b/tutorials/01-introduction.ipynb @@ -16,10 +16,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:55.333137Z", - "iopub.status.busy": "2023-10-19T14:39:55.332800Z", - "iopub.status.idle": "2023-10-19T14:39:55.620635Z", - "shell.execute_reply": "2023-10-19T14:39:55.620092Z" + "iopub.execute_input": "2023-10-19T16:27:36.509941Z", + "iopub.status.busy": "2023-10-19T16:27:36.509492Z", + "iopub.status.idle": "2023-10-19T16:27:36.878359Z", + "shell.execute_reply": "2023-10-19T16:27:36.877646Z" } }, "outputs": [], @@ -62,10 +62,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:55.625193Z", - "iopub.status.busy": "2023-10-19T14:39:55.624119Z", - "iopub.status.idle": "2023-10-19T14:39:55.629183Z", - "shell.execute_reply": "2023-10-19T14:39:55.628710Z" + "iopub.execute_input": "2023-10-19T16:27:36.884089Z", + "iopub.status.busy": "2023-10-19T16:27:36.882169Z", + "iopub.status.idle": "2023-10-19T16:27:36.888779Z", + "shell.execute_reply": "2023-10-19T16:27:36.888221Z" } }, "outputs": [], @@ -93,10 +93,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:55.633035Z", - "iopub.status.busy": "2023-10-19T14:39:55.632089Z", - "iopub.status.idle": "2023-10-19T14:39:55.636031Z", - "shell.execute_reply": "2023-10-19T14:39:55.635577Z" + "iopub.execute_input": "2023-10-19T16:27:36.893261Z", + "iopub.status.busy": "2023-10-19T16:27:36.892022Z", + "iopub.status.idle": "2023-10-19T16:27:36.896757Z", + "shell.execute_reply": "2023-10-19T16:27:36.896155Z" } }, "outputs": [], diff --git a/tutorials/02-orbital-rotation.ipynb b/tutorials/02-orbital-rotation.ipynb index be6e21fe5..9a019f00c 100644 --- a/tutorials/02-orbital-rotation.ipynb +++ b/tutorials/02-orbital-rotation.ipynb @@ -43,10 +43,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.127490Z", - "iopub.status.busy": "2023-10-19T14:39:57.127250Z", - "iopub.status.idle": "2023-10-19T14:39:57.415242Z", - "shell.execute_reply": "2023-10-19T14:39:57.414684Z" + "iopub.execute_input": "2023-10-19T16:27:38.740446Z", + "iopub.status.busy": "2023-10-19T16:27:38.740199Z", + "iopub.status.idle": "2023-10-19T16:27:39.133772Z", + "shell.execute_reply": "2023-10-19T16:27:39.133089Z" } }, "outputs": [], @@ -111,10 +111,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.419456Z", - "iopub.status.busy": "2023-10-19T14:39:57.418437Z", - "iopub.status.idle": "2023-10-19T14:39:57.443882Z", - "shell.execute_reply": "2023-10-19T14:39:57.443356Z" + "iopub.execute_input": "2023-10-19T16:27:39.139249Z", + "iopub.status.busy": "2023-10-19T16:27:39.137973Z", + "iopub.status.idle": "2023-10-19T16:27:39.170534Z", + "shell.execute_reply": "2023-10-19T16:27:39.169918Z" } }, "outputs": [], @@ -160,10 +160,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.447969Z", - "iopub.status.busy": "2023-10-19T14:39:57.447021Z", - "iopub.status.idle": "2023-10-19T14:39:57.458057Z", - "shell.execute_reply": "2023-10-19T14:39:57.457553Z" + "iopub.execute_input": "2023-10-19T16:27:39.175431Z", + "iopub.status.busy": "2023-10-19T16:27:39.174296Z", + "iopub.status.idle": "2023-10-19T16:27:39.187414Z", + "shell.execute_reply": "2023-10-19T16:27:39.186695Z" } }, "outputs": [], @@ -203,10 +203,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:57.462338Z", - "iopub.status.busy": "2023-10-19T14:39:57.461004Z", - "iopub.status.idle": "2023-10-19T14:39:57.467050Z", - "shell.execute_reply": "2023-10-19T14:39:57.466562Z" + "iopub.execute_input": "2023-10-19T16:27:39.192482Z", + "iopub.status.busy": "2023-10-19T16:27:39.190867Z", + "iopub.status.idle": "2023-10-19T16:27:39.197986Z", + "shell.execute_reply": "2023-10-19T16:27:39.197420Z" } }, "outputs": [], diff --git a/tutorials/03-double-factorized.html b/tutorials/03-double-factorized.html index 270204248..1cd1a40c2 100644 --- a/tutorials/03-double-factorized.html +++ b/tutorials/03-double-factorized.html @@ -84,7 +84,9 @@

    Double-factorized representation of the molecular Hamiltonianmol_hamiltonian = mol_data.hamiltonian # Get the Hamiltonian in the double-factorized representation -df_hamiltonian = ffsim.double_factorized_hamiltonian(mol_hamiltonian) +df_hamiltonian = ffsim.DoubleFactorizedHamiltonian.from_molecular_hamiltonian( + mol_hamiltonian +) @@ -96,7 +98,7 @@

    Double-factorized representation of the molecular Hamiltoniandouble_factorized_hamiltonian returns an object of type DoubleFactorizedHamiltonian which is just a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations.

    +

    Here, mol_hamiltonian is an instance of MolecularHamiltonian, a dataclass that stores the one- and two-body tensors, and df_hamiltonian is an instance of DoubleFactorizedHamiltonian, a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations.

    Now, we set the evolution time and calculate the exact result of time evolution by directly exponentiating the Hamiltonian using SciPy. Later, we will compare the result of our approximate time evolution with this exact result.

    @@ -352,7 +354,7 @@

    Implementing Trotter simulation of the double-factorized Hamiltonian
    -Fidelity of Trotter-evolved state with exact state: 0.9990275744083491
    +Fidelity of Trotter-evolved state with exact state: 0.999027574408349
     

    The fidelity of the final result can be improved by increasing the number of Trotter steps.

    @@ -379,7 +381,7 @@

    Implementing Trotter simulation of the double-factorized Hamiltonian
    -Fidelity of Trotter-evolved state with exact state: 0.9999906233109653
    +Fidelity of Trotter-evolved state with exact state: 0.9999906233109657
     

    As mentioned above, ffsim already includes functionality for Trotter simulation of double-factorized Hamiltonians. The implementation in ffsim includes higher-order Trotter-Suzuki formulas. The first-order asymmetric formula that we just implemented corresponds to order=0 in ffsim’s implementation. order=1 corresponds to the first-order symmetric (commonly known as the second-order) formula, order=2 corresponds to the second-order symmetric (fourth-order) formula, and so on.

    @@ -408,7 +410,7 @@

    Implementing Trotter simulation of the double-factorized Hamiltonian
    -Fidelity of Trotter-evolved state with exact state: 0.9999906233109653
    +Fidelity of Trotter-evolved state with exact state: 0.9999906233109657
     

    A higher order formula achieves a higher fidelity with fewer Trotter steps:

    @@ -436,7 +438,7 @@

    Implementing Trotter simulation of the double-factorized Hamiltonian
    -Fidelity of Trotter-evolved state with exact state: 0.9999999336740059
    +Fidelity of Trotter-evolved state with exact state: 0.9999999336740057
     

    diff --git a/tutorials/03-double-factorized.ipynb b/tutorials/03-double-factorized.ipynb index 2cb8abca1..09532880c 100644 --- a/tutorials/03-double-factorized.ipynb +++ b/tutorials/03-double-factorized.ipynb @@ -43,10 +43,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:58.908837Z", - "iopub.status.busy": "2023-10-19T14:39:58.908499Z", - "iopub.status.idle": "2023-10-19T14:39:59.292292Z", - "shell.execute_reply": "2023-10-19T14:39:59.291735Z" + "iopub.execute_input": "2023-10-19T16:27:41.295062Z", + "iopub.status.busy": "2023-10-19T16:27:41.294805Z", + "iopub.status.idle": "2023-10-19T16:27:41.768940Z", + "shell.execute_reply": "2023-10-19T16:27:41.768320Z" } }, "outputs": [ @@ -78,14 +78,16 @@ "mol_hamiltonian = mol_data.hamiltonian\n", "\n", "# Get the Hamiltonian in the double-factorized representation\n", - "df_hamiltonian = ffsim.double_factorized_hamiltonian(mol_hamiltonian)" + "df_hamiltonian = ffsim.DoubleFactorizedHamiltonian.from_molecular_hamiltonian(\n", + " mol_hamiltonian\n", + ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The function `double_factorized_hamiltonian` returns an object of type `DoubleFactorizedHamiltonian` which is just a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations." + "Here, `mol_hamiltonian` is an instance of `MolecularHamiltonian`, a dataclass that stores the one- and two-body tensors, and `df_hamiltonian` is an instance of `DoubleFactorizedHamiltonian`, a dataclass that stores the updated one-body-tensor, diagonal Coulomb matrices, and orbital rotations. In the cell below, we print out the tensors describing the original and double-factorized representations." ] }, { @@ -93,10 +95,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.296046Z", - "iopub.status.busy": "2023-10-19T14:39:59.295505Z", - "iopub.status.idle": "2023-10-19T14:39:59.303680Z", - "shell.execute_reply": "2023-10-19T14:39:59.303208Z" + "iopub.execute_input": "2023-10-19T16:27:41.797788Z", + "iopub.status.busy": "2023-10-19T16:27:41.796959Z", + "iopub.status.idle": "2023-10-19T16:27:41.805806Z", + "shell.execute_reply": "2023-10-19T16:27:41.805115Z" } }, "outputs": [ @@ -111,44 +113,44 @@ " [-3.07220771e-16 -6.77238770e-01]]\n", "\n", "Two-body tensor:\n", - "[[[[5.23173938e-01 1.94289029e-16]\n", - " [1.94289029e-16 5.33545754e-01]]\n", + "[[[[5.23173938e-01 1.57437591e-16]\n", + " [1.57437591e-16 5.33545754e-01]]\n", "\n", - " [[1.94289029e-16 2.48240570e-01]\n", - " [2.48240570e-01 8.32667268e-17]]]\n", + " [[2.12704463e-16 2.48240570e-01]\n", + " [2.48240570e-01 1.61492903e-16]]]\n", "\n", "\n", - " [[[1.94289029e-16 2.48240570e-01]\n", - " [2.48240570e-01 8.32667268e-17]]\n", + " [[[2.12704463e-16 2.48240570e-01]\n", + " [2.48240570e-01 1.61492903e-16]]\n", "\n", - " [[5.33545754e-01 1.11022302e-16]\n", - " [1.11022302e-16 5.53132024e-01]]]]\n", + " [[5.33545754e-01 1.24884750e-16]\n", + " [1.24884750e-16 5.53132024e-01]]]]\n", "\n", "Double-factorized representation\n", "--------------------------------\n", "One-body tensor:\n", - "[[-1.21318608e+00 -4.05183033e-16]\n", - " [-4.59876437e-16 -1.07792507e+00]]\n", + "[[-1.21318608e+00 -4.25870402e-16]\n", + " [-4.76015378e-16 -1.07792507e+00]]\n", "\n", "Diagonal Coulomb matrices:\n", - "[[[ 5.14653029e-001 5.33545754e-001]\n", - " [ 5.33545754e-001 5.53132024e-001]]\n", + "[[[ 5.14653029e-01 5.33545754e-01]\n", + " [ 5.33545754e-01 5.53132024e-01]]\n", "\n", - " [[ 2.48240570e-001 -2.48240570e-001]\n", - " [-2.48240570e-001 2.48240570e-001]]\n", + " [[ 2.48240570e-01 -2.48240570e-01]\n", + " [-2.48240570e-01 2.48240570e-01]]\n", "\n", - " [[ 5.96958401e-121 -7.13206008e-062]\n", - " [-7.13206008e-062 8.52090881e-003]]]\n", + " [[ 1.50800163e-59 -3.58462611e-31]\n", + " [-3.58462611e-31 8.52090881e-03]]]\n", "\n", "Orbital rotations:\n", - "[[[-1.00000000e+00 4.25128053e-15]\n", - " [ 4.25128053e-15 1.00000000e+00]]\n", + "[[[-1.00000000e+00 8.24520980e-15]\n", + " [ 8.24520980e-15 1.00000000e+00]]\n", "\n", - " [[ 7.07106781e-01 -7.07106781e-01]\n", - " [-7.07106781e-01 -7.07106781e-01]]\n", + " [[-7.07106781e-01 -7.07106781e-01]\n", + " [ 7.07106781e-01 -7.07106781e-01]]\n", "\n", - " [[ 2.89310728e-30 -1.00000000e+00]\n", - " [-1.00000000e+00 -2.89310728e-30]]]\n" + " [[ 6.48603030e-15 -1.00000000e+00]\n", + " [-1.00000000e+00 -6.48603030e-15]]]\n" ] } ], @@ -227,10 +229,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.307553Z", - "iopub.status.busy": "2023-10-19T14:39:59.306455Z", - "iopub.status.idle": "2023-10-19T14:39:59.312345Z", - "shell.execute_reply": "2023-10-19T14:39:59.311867Z" + "iopub.execute_input": "2023-10-19T16:27:41.808878Z", + "iopub.status.busy": "2023-10-19T16:27:41.808498Z", + "iopub.status.idle": "2023-10-19T16:27:41.813796Z", + "shell.execute_reply": "2023-10-19T16:27:41.813248Z" } }, "outputs": [], @@ -285,10 +287,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.315343Z", - "iopub.status.busy": "2023-10-19T14:39:59.315133Z", - "iopub.status.idle": "2023-10-19T14:39:59.319932Z", - "shell.execute_reply": "2023-10-19T14:39:59.319386Z" + "iopub.execute_input": "2023-10-19T16:27:41.816718Z", + "iopub.status.busy": "2023-10-19T16:27:41.816364Z", + "iopub.status.idle": "2023-10-19T16:27:41.820574Z", + "shell.execute_reply": "2023-10-19T16:27:41.820031Z" } }, "outputs": [], @@ -325,10 +327,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.322653Z", - "iopub.status.busy": "2023-10-19T14:39:59.322251Z", - "iopub.status.idle": "2023-10-19T14:39:59.327160Z", - "shell.execute_reply": "2023-10-19T14:39:59.326695Z" + "iopub.execute_input": "2023-10-19T16:27:41.823525Z", + "iopub.status.busy": "2023-10-19T16:27:41.823163Z", + "iopub.status.idle": "2023-10-19T16:27:41.828409Z", + "shell.execute_reply": "2023-10-19T16:27:41.827885Z" } }, "outputs": [ @@ -336,7 +338,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Hartree Fock energy: -0.837796382593709\n" + "Hartree Fock energy: -0.8377963825937088\n" ] } ], @@ -367,10 +369,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.329875Z", - "iopub.status.busy": "2023-10-19T14:39:59.329325Z", - "iopub.status.idle": "2023-10-19T14:39:59.339042Z", - "shell.execute_reply": "2023-10-19T14:39:59.338412Z" + "iopub.execute_input": "2023-10-19T16:27:41.831595Z", + "iopub.status.busy": "2023-10-19T16:27:41.831104Z", + "iopub.status.idle": "2023-10-19T16:27:41.842211Z", + "shell.execute_reply": "2023-10-19T16:27:41.841656Z" } }, "outputs": [ @@ -409,10 +411,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.341671Z", - "iopub.status.busy": "2023-10-19T14:39:59.341479Z", - "iopub.status.idle": "2023-10-19T14:39:59.349853Z", - "shell.execute_reply": "2023-10-19T14:39:59.349232Z" + "iopub.execute_input": "2023-10-19T16:27:41.845098Z", + "iopub.status.busy": "2023-10-19T16:27:41.844747Z", + "iopub.status.idle": "2023-10-19T16:27:41.853809Z", + "shell.execute_reply": "2023-10-19T16:27:41.853262Z" } }, "outputs": [ @@ -420,7 +422,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9990275744083491\n" + "Fidelity of Trotter-evolved state with exact state: 0.999027574408349\n" ] } ], @@ -450,10 +452,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.353772Z", - "iopub.status.busy": "2023-10-19T14:39:59.353568Z", - "iopub.status.idle": "2023-10-19T14:39:59.390939Z", - "shell.execute_reply": "2023-10-19T14:39:59.389931Z" + "iopub.execute_input": "2023-10-19T16:27:41.856607Z", + "iopub.status.busy": "2023-10-19T16:27:41.856244Z", + "iopub.status.idle": "2023-10-19T16:27:41.899624Z", + "shell.execute_reply": "2023-10-19T16:27:41.898940Z" } }, "outputs": [ @@ -461,7 +463,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9999906233109653\n" + "Fidelity of Trotter-evolved state with exact state: 0.9999906233109657\n" ] } ], @@ -493,10 +495,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.393689Z", - "iopub.status.busy": "2023-10-19T14:39:59.393490Z", - "iopub.status.idle": "2023-10-19T14:39:59.425221Z", - "shell.execute_reply": "2023-10-19T14:39:59.424460Z" + "iopub.execute_input": "2023-10-19T16:27:41.902790Z", + "iopub.status.busy": "2023-10-19T16:27:41.902330Z", + "iopub.status.idle": "2023-10-19T16:27:41.945843Z", + "shell.execute_reply": "2023-10-19T16:27:41.945194Z" } }, "outputs": [ @@ -504,7 +506,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9999906233109653\n" + "Fidelity of Trotter-evolved state with exact state: 0.9999906233109657\n" ] } ], @@ -535,10 +537,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:39:59.427658Z", - "iopub.status.busy": "2023-10-19T14:39:59.427469Z", - "iopub.status.idle": "2023-10-19T14:39:59.443022Z", - "shell.execute_reply": "2023-10-19T14:39:59.442331Z" + "iopub.execute_input": "2023-10-19T16:27:41.949120Z", + "iopub.status.busy": "2023-10-19T16:27:41.948837Z", + "iopub.status.idle": "2023-10-19T16:27:41.967055Z", + "shell.execute_reply": "2023-10-19T16:27:41.966238Z" } }, "outputs": [ @@ -546,7 +548,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fidelity of Trotter-evolved state with exact state: 0.9999999336740059\n" + "Fidelity of Trotter-evolved state with exact state: 0.9999999336740057\n" ] } ], diff --git a/tutorials/04-lucj.html b/tutorials/04-lucj.html index 4c09e8dcc..90fc1c8d4 100644 --- a/tutorials/04-lucj.html +++ b/tutorials/04-lucj.html @@ -94,8 +94,8 @@

    The local unitary cluster Jastrow (LUCJ) ansatz
    -converged SCF energy = -77.4456267643961
    -CASCI E = -77.6290254326717  E(CI) = -3.57322412553863  S^2 = 0.0000000
    +converged SCF energy = -77.4456267643962
    +CASCI E = -77.6290254326717  E(CI) = -3.57322412553862  S^2 = 0.0000000
     
    @@ -151,8 +151,8 @@

    The unitary cluster Jastrow (UCJ) ansatz
    -E(CCSD) = -77.49387212754462  E_corr = -0.04824536314851573
    -Energy at initialialization: -77.46975600021692
    +E(CCSD) = -77.49387212754473  E_corr = -0.04824536314851328
    +Energy at initialialization: -77.46975600021656
     

    To facilitate variational optimization of the ansatz, UCJOperator implements methods for conversion to and from a vector of real-valued parameters. The precise relation between a parameter vector and the matrices of the UCJ operator is somewhat complicated. In short, the parameter vector stores the entries of the UCJ matrices in a non-redundant way (for the orbital rotations, the parameter vector actually stores the entries of their generators.)

    @@ -193,12 +193,12 @@

    The unitary cluster Jastrow (UCJ) ansatz\n" ] } @@ -252,10 +252,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:41:13.662631Z", - "iopub.status.busy": "2023-10-19T14:41:13.661664Z", - "iopub.status.idle": "2023-10-19T14:42:35.356542Z", - "shell.execute_reply": "2023-10-19T14:42:35.356016Z" + "iopub.execute_input": "2023-10-19T16:29:31.895316Z", + "iopub.status.busy": "2023-10-19T16:29:31.894949Z", + "iopub.status.idle": "2023-10-19T16:30:19.776632Z", + "shell.execute_reply": "2023-10-19T16:30:19.776089Z" } }, "outputs": [ @@ -267,12 +267,12 @@ " message: CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH\n", " success: True\n", " status: 0\n", - " fun: -77.62881470757267\n", - " x: [-3.795e+00 -1.386e+00 ... -4.020e-01 1.230e-01]\n", - " nit: 585\n", - " jac: [ 4.434e-04 -1.933e-04 ... 4.007e-04 -1.450e-04]\n", - " nfev: 29422\n", - " njev: 626\n", + " fun: -77.62873223663462\n", + " x: [-1.942e+00 3.888e-01 ... 3.479e-01 -8.915e-02]\n", + " nit: 285\n", + " jac: [ 1.563e-05 3.695e-05 ... -1.279e-05 -1.776e-04]\n", + " nfev: 14335\n", + " njev: 305\n", " hess_inv: <46x46 LbfgsInvHessProduct with dtype=float64>\n" ] } diff --git a/tutorials/05-fermion-operator.html b/tutorials/05-fermion-operator.html index 95315f332..f8a4dd5b1 100644 --- a/tutorials/05-fermion-operator.html +++ b/tutorials/05-fermion-operator.html @@ -78,8 +78,8 @@

    The FermionOperator class
     FermionOperator({
    -    (cre_a(0), des_a(3)): 0.5,
         (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
     })
     
    @@ -99,7 +99,7 @@

    The FermionOperator class
    -'FermionOperator({((True, False, 0), (False, False, 3)): 0.5+0j, ((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 3), (False, False, 0)): -0.25+0j})'
    +'FermionOperator({((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 0), (False, False, 3)): 0.5+0j, ((True, False, 3), (False, False, 0)): -0.25+0j})'
     

    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.

    @@ -128,16 +128,16 @@

    The FermionOperator class
     FermionOperator({
         (des_a(3), des_b(3)): 0.0625,
    -    (cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,
    -    (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)): -0.5,
         (cre_a(0), des_a(3), cre_b(2)): 0+0.5j,
    -    (cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,
    -    (cre_a(0), des_a(3)): 1,
    -    (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_a(0), des_a(3)): 1,
         (cre_a(3), des_a(0), cre_b(2)): 0-0.25j,
    -    (cre_b(2)): 0-0.25j
    +    (cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,
    +    (cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,
    +    (cre_b(2)): 0-0.25j,
    +    (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -0.25-0.25j,
    +    (cre_b(1), des_b(5), cre_a(4)): 2+2j,
    +    (cre_a(3), des_a(0)): -0.5
     })
     
    @@ -163,16 +163,16 @@

    The FermionOperator class
     FermionOperator({
         (des_a(3), des_b(3)): 0-1.25j,
    -    (cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,
    -    (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,
    -    (cre_a(3), des_a(0)): 0+3j,
         (cre_a(0), des_a(3), cre_b(2)): 2,
    -    (cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,
    -    (cre_a(0), des_a(3)): 0-6j,
    -    (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_a(0), des_a(3)): 0-6j,
         (cre_a(3), des_a(0), cre_b(2)): -1,
    -    (cre_b(2)): -5
    +    (cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,
    +    (cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,
    +    (cre_b(2)): -5,
    +    (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,
    +    (cre_b(1), des_b(5), cre_a(4)): 12-12j,
    +    (cre_a(3), des_a(0)): 0+3j
     })
     
    @@ -193,16 +193,16 @@

    The FermionOperator class
     FermionOperator({
    -    (cre_a(3), des_a(0)): 0+3j,
    -    (cre_b(2)): -5,
    -    (cre_b(1), cre_a(4), des_b(5), des_b(3), des_a(3)): -1+1j,
    -    (cre_b(2), cre_b(1), cre_a(4), des_b(5)): 4+4j,
    -    (cre_a(0), des_a(3)): 0-6j,
    -    (cre_b(2), cre_a(0), des_a(3)): 2,
    -    (cre_a(3), des_b(3), des_a(3), des_a(0)): 0+0.25j,
         (des_b(3), des_a(3)): 0+1.25j,
    +    (cre_b(2), cre_a(0), des_a(3)): 2,
    +    (cre_a(0), des_a(3)): 0-6j,
         (cre_b(2), cre_a(3), des_a(0)): -1,
    -    (cre_b(1), cre_a(4), des_b(5)): -12+12j
    +    (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_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), des_b(3), des_a(3)): -1+1j,
    +    (cre_b(2)): -5
     })
     
    @@ -271,11 +271,11 @@

    The FermionOperator class
    -array([0.        +0.j        , 0.        +0.j        ,
    -       0.        +0.j        , 0.        +0.j        ,
    -       0.11889056-0.13114645j, 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.14601055-0.2517831j, 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.

    diff --git a/tutorials/05-fermion-operator.ipynb b/tutorials/05-fermion-operator.ipynb index fa09bcb38..e5cda2ddd 100644 --- a/tutorials/05-fermion-operator.ipynb +++ b/tutorials/05-fermion-operator.ipynb @@ -29,10 +29,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.077633Z", - "iopub.status.busy": "2023-10-19T14:42:37.077306Z", - "iopub.status.idle": "2023-10-19T14:42:37.362479Z", - "shell.execute_reply": "2023-10-19T14:42:37.361769Z" + "iopub.execute_input": "2023-10-19T16:30:21.670393Z", + "iopub.status.busy": "2023-10-19T16:30:21.669989Z", + "iopub.status.idle": "2023-10-19T16:30:22.023880Z", + "shell.execute_reply": "2023-10-19T16:30:22.023224Z" } }, "outputs": [ @@ -40,8 +40,8 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_a(0), des_a(3)): 0.5,\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", "})" ] @@ -76,17 +76,17 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.367296Z", - "iopub.status.busy": "2023-10-19T14:42:37.366261Z", - "iopub.status.idle": "2023-10-19T14:42:37.372138Z", - "shell.execute_reply": "2023-10-19T14:42:37.371678Z" + "iopub.execute_input": "2023-10-19T16:30:22.028811Z", + "iopub.status.busy": "2023-10-19T16:30:22.027408Z", + "iopub.status.idle": "2023-10-19T16:30:22.034307Z", + "shell.execute_reply": "2023-10-19T16:30:22.033759Z" } }, "outputs": [ { "data": { "text/plain": [ - "'FermionOperator({((True, False, 0), (False, False, 3)): 0.5+0j, ((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 3), (False, False, 0)): -0.25+0j})'" + "'FermionOperator({((True, True, 1), (False, True, 5), (True, False, 4)): 1+1j, ((True, False, 0), (False, False, 3)): 0.5+0j, ((True, False, 3), (False, False, 0)): -0.25+0j})'" ] }, "execution_count": 2, @@ -110,10 +110,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.375800Z", - "iopub.status.busy": "2023-10-19T14:42:37.374921Z", - "iopub.status.idle": "2023-10-19T14:42:37.381567Z", - "shell.execute_reply": "2023-10-19T14:42:37.381116Z" + "iopub.execute_input": "2023-10-19T16:30:22.037944Z", + "iopub.status.busy": "2023-10-19T16:30:22.037568Z", + "iopub.status.idle": "2023-10-19T16:30:22.044977Z", + "shell.execute_reply": "2023-10-19T16:30:22.044445Z" } }, "outputs": [ @@ -122,16 +122,16 @@ "text/plain": [ "FermionOperator({\n", " (des_a(3), des_b(3)): 0.0625,\n", - " (cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,\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)): -0.5,\n", " (cre_a(0), des_a(3), cre_b(2)): 0+0.5j,\n", - " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,\n", - " (cre_a(0), des_a(3)): 1,\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_a(0), des_a(3)): 1,\n", " (cre_a(3), des_a(0), cre_b(2)): 0-0.25j,\n", - " (cre_b(2)): 0-0.25j\n", + " (cre_a(0), des_a(3), des_a(3), des_b(3)): -0.125,\n", + " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): -1+1j,\n", + " (cre_b(2)): 0-0.25j,\n", + " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -0.25-0.25j,\n", + " (cre_b(1), des_b(5), cre_a(4)): 2+2j,\n", + " (cre_a(3), des_a(0)): -0.5\n", "})" ] }, @@ -169,10 +169,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.385304Z", - "iopub.status.busy": "2023-10-19T14:42:37.384396Z", - "iopub.status.idle": "2023-10-19T14:42:37.390385Z", - "shell.execute_reply": "2023-10-19T14:42:37.389901Z" + "iopub.execute_input": "2023-10-19T16:30:22.049374Z", + "iopub.status.busy": "2023-10-19T16:30:22.048155Z", + "iopub.status.idle": "2023-10-19T16:30:22.054897Z", + "shell.execute_reply": "2023-10-19T16:30:22.054383Z" } }, "outputs": [ @@ -181,16 +181,16 @@ "text/plain": [ "FermionOperator({\n", " (des_a(3), des_b(3)): 0-1.25j,\n", - " (cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,\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)): 0+3j,\n", " (cre_a(0), des_a(3), cre_b(2)): 2,\n", - " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,\n", - " (cre_a(0), des_a(3)): 0-6j,\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_a(0), des_a(3)): 0-6j,\n", " (cre_a(3), des_a(0), cre_b(2)): -1,\n", - " (cre_b(2)): -5\n", + " (cre_a(0), des_a(3), des_a(3), des_b(3)): 0+0.5j,\n", + " (cre_b(1), des_b(5), cre_a(4), cre_b(2)): 4+4j,\n", + " (cre_b(2)): -5,\n", + " (cre_b(1), des_b(5), cre_a(4), des_a(3), des_b(3)): -1+1j,\n", + " (cre_b(1), des_b(5), cre_a(4)): 12-12j,\n", + " (cre_a(3), des_a(0)): 0+3j\n", "})" ] }, @@ -219,10 +219,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.394709Z", - "iopub.status.busy": "2023-10-19T14:42:37.393740Z", - "iopub.status.idle": "2023-10-19T14:42:37.399514Z", - "shell.execute_reply": "2023-10-19T14:42:37.399055Z" + "iopub.execute_input": "2023-10-19T16:30:22.058256Z", + "iopub.status.busy": "2023-10-19T16:30:22.057797Z", + "iopub.status.idle": "2023-10-19T16:30:22.064878Z", + "shell.execute_reply": "2023-10-19T16:30:22.064352Z" } }, "outputs": [ @@ -230,16 +230,16 @@ "data": { "text/plain": [ "FermionOperator({\n", - " (cre_a(3), des_a(0)): 0+3j,\n", - " (cre_b(2)): -5,\n", - " (cre_b(1), cre_a(4), des_b(5), des_b(3), des_a(3)): -1+1j,\n", - " (cre_b(2), cre_b(1), cre_a(4), des_b(5)): 4+4j,\n", - " (cre_a(0), des_a(3)): 0-6j,\n", - " (cre_b(2), cre_a(0), des_a(3)): 2,\n", - " (cre_a(3), des_b(3), des_a(3), des_a(0)): 0+0.25j,\n", " (des_b(3), des_a(3)): 0+1.25j,\n", + " (cre_b(2), cre_a(0), des_a(3)): 2,\n", + " (cre_a(0), des_a(3)): 0-6j,\n", " (cre_b(2), cre_a(3), des_a(0)): -1,\n", - " (cre_b(1), cre_a(4), des_b(5)): -12+12j\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_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), des_b(3), des_a(3)): -1+1j,\n", + " (cre_b(2)): -5\n", "})" ] }, @@ -264,10 +264,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.403183Z", - "iopub.status.busy": "2023-10-19T14:42:37.402262Z", - "iopub.status.idle": "2023-10-19T14:42:37.407487Z", - "shell.execute_reply": "2023-10-19T14:42:37.407040Z" + "iopub.execute_input": "2023-10-19T16:30:22.069240Z", + "iopub.status.busy": "2023-10-19T16:30:22.068020Z", + "iopub.status.idle": "2023-10-19T16:30:22.074090Z", + "shell.execute_reply": "2023-10-19T16:30:22.073516Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.411097Z", - "iopub.status.busy": "2023-10-19T14:42:37.410179Z", - "iopub.status.idle": "2023-10-19T14:42:37.416471Z", - "shell.execute_reply": "2023-10-19T14:42:37.416023Z" + "iopub.execute_input": "2023-10-19T16:30:22.078346Z", + "iopub.status.busy": "2023-10-19T16:30:22.077123Z", + "iopub.status.idle": "2023-10-19T16:30:22.084444Z", + "shell.execute_reply": "2023-10-19T16:30:22.083907Z" } }, "outputs": [ @@ -340,21 +340,21 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.420049Z", - "iopub.status.busy": "2023-10-19T14:42:37.419152Z", - "iopub.status.idle": "2023-10-19T14:42:37.426669Z", - "shell.execute_reply": "2023-10-19T14:42:37.426204Z" + "iopub.execute_input": "2023-10-19T16:30:22.087872Z", + "iopub.status.busy": "2023-10-19T16:30:22.087478Z", + "iopub.status.idle": "2023-10-19T16:30:22.095690Z", + "shell.execute_reply": "2023-10-19T16:30:22.095163Z" } }, "outputs": [ { "data": { "text/plain": [ - "array([0. +0.j , 0. +0.j ,\n", - " 0. +0.j , 0. +0.j ,\n", - " 0.11889056-0.13114645j, 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.14601055-0.2517831j, 0. +0.j ,\n", + " 0. +0.j , 0. +0.j ,\n", + " 0. +0.j ])" ] }, "execution_count": 8, @@ -379,10 +379,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2023-10-19T14:42:37.430250Z", - "iopub.status.busy": "2023-10-19T14:42:37.429345Z", - "iopub.status.idle": "2023-10-19T14:42:37.441262Z", - "shell.execute_reply": "2023-10-19T14:42:37.440811Z" + "iopub.execute_input": "2023-10-19T16:30:22.099160Z", + "iopub.status.busy": "2023-10-19T16:30:22.098684Z", + "iopub.status.idle": "2023-10-19T16:30:22.112817Z", + "shell.execute_reply": "2023-10-19T16:30:22.112282Z" } }, "outputs": [