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 @@
The number of spatial orbitals.
-Return the Hamiltonian in the “number” representation.
-Return the Hamiltonian in the “Z” representation.
-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 @@
“Z” representation
The “Z” representation of the double factorization is an alternative representation that sometimes yields simpler quantum circuits.
@@ -211,8 +182,8 @@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.
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.
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.
optimize
is set to True.
The number of spatial orbitals.
+Return the Hamiltonian in the “number” representation.
+Return the Hamiltonian in the “Z” representation.
+DoubleFactorizedHamiltonian.orbital_rotations
DoubleFactorizedHamiltonian.constant
DoubleFactorizedHamiltonian.z_representation
DoubleFactorizedHamiltonian.from_molecular_hamiltonian()
DoubleFactorizedHamiltonian.norb
DoubleFactorizedHamiltonian.to_number_representation()
DoubleFactorizedHamiltonian.to_z_representation()
double_factorized_hamiltonian()
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.
[2]:
-Hartree Fock energy: -0.837796382593709
+Hartree Fock energy: -0.8377963825937088
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 @@
-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 @@
-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.
-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 @@
-Fidelity of Trotter-evolved state with exact state: 0.9999999336740059
+Fidelity of Trotter-evolved state with exact state: 0.9999999336740057
-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
-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.)
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
})
-'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
.
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 @@
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 @@
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
})
-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
.