|
14 | 14 | }, |
15 | 15 | { |
16 | 16 | "cell_type": "code", |
17 | | - "execution_count": 1, |
18 | 17 | "id": "1", |
19 | | - "metadata": {}, |
20 | | - "outputs": [], |
| 18 | + "metadata": { |
| 19 | + "ExecuteTime": { |
| 20 | + "end_time": "2025-12-07T09:40:13.042483Z", |
| 21 | + "start_time": "2025-12-07T09:40:12.578920Z" |
| 22 | + } |
| 23 | + }, |
21 | 24 | "source": [ |
22 | 25 | "!pip install -qq \"classiq[chemistry]\"" |
23 | | - ] |
| 26 | + ], |
| 27 | + "outputs": [ |
| 28 | + { |
| 29 | + "name": "stdout", |
| 30 | + "output_type": "stream", |
| 31 | + "text": [ |
| 32 | + "zsh:1: command not found: pip\r\n" |
| 33 | + ] |
| 34 | + } |
| 35 | + ], |
| 36 | + "execution_count": 1 |
24 | 37 | }, |
25 | 38 | { |
26 | 39 | "cell_type": "markdown", |
|
34 | 47 | }, |
35 | 48 | { |
36 | 49 | "cell_type": "code", |
37 | | - "execution_count": 2, |
38 | 50 | "id": "3", |
39 | | - "metadata": {}, |
40 | | - "outputs": [ |
41 | | - { |
42 | | - "name": "stdout", |
43 | | - "output_type": "stream", |
44 | | - "text": [ |
45 | | - "[0.2 0.4 0.6 0.8 1. 1.4 1.75 2.1 2.45 2.8 3.15 3.5 ]\n" |
46 | | - ] |
| 51 | + "metadata": { |
| 52 | + "ExecuteTime": { |
| 53 | + "end_time": "2025-12-07T09:40:23.484849Z", |
| 54 | + "start_time": "2025-12-07T09:40:23.356247Z" |
47 | 55 | } |
48 | | - ], |
| 56 | + }, |
49 | 57 | "source": [ |
50 | 58 | "import numpy as np\n", |
51 | 59 | "\n", |
|
65 | 73 | "exact_energy = []\n", |
66 | 74 | "\n", |
67 | 75 | "print(distance)" |
68 | | - ] |
| 76 | + ], |
| 77 | + "outputs": [ |
| 78 | + { |
| 79 | + "name": "stdout", |
| 80 | + "output_type": "stream", |
| 81 | + "text": [ |
| 82 | + "[0.2 0.4 0.6 0.8 1. 1.4 1.75 2.1 2.45 2.8 3.15 3.5 ]\n" |
| 83 | + ] |
| 84 | + } |
| 85 | + ], |
| 86 | + "execution_count": 2 |
69 | 87 | }, |
70 | 88 | { |
71 | 89 | "cell_type": "markdown", |
|
85 | 103 | }, |
86 | 104 | { |
87 | 105 | "cell_type": "code", |
88 | | - "execution_count": 3, |
89 | 106 | "id": "5", |
90 | | - "metadata": {}, |
91 | | - "outputs": [], |
| 107 | + "metadata": { |
| 108 | + "ExecuteTime": { |
| 109 | + "end_time": "2025-12-07T09:40:34.978365Z", |
| 110 | + "start_time": "2025-12-07T09:40:33.863247Z" |
| 111 | + } |
| 112 | + }, |
92 | 113 | "source": [ |
93 | 114 | "import time\n", |
94 | 115 | "\n", |
95 | 116 | "from classiq import *" |
96 | | - ] |
| 117 | + ], |
| 118 | + "outputs": [], |
| 119 | + "execution_count": 3 |
97 | 120 | }, |
98 | 121 | { |
99 | 122 | "cell_type": "code", |
100 | | - "execution_count": 4, |
101 | 123 | "id": "6", |
102 | | - "metadata": {}, |
103 | | - "outputs": [ |
104 | | - { |
105 | | - "name": "stdout", |
106 | | - "output_type": "stream", |
107 | | - "text": [ |
108 | | - "5.491310119628906\n", |
109 | | - "3.4504880905151367\n", |
110 | | - "3.622476100921631\n", |
111 | | - "3.6536712646484375\n", |
112 | | - "4.562683820724487\n", |
113 | | - "3.6052770614624023\n", |
114 | | - "22.708916187286377\n", |
115 | | - "3.747389793395996\n", |
116 | | - "3.954115152359009\n", |
117 | | - "3.929457902908325\n", |
118 | | - "3.692626953125\n", |
119 | | - "3.841586112976074\n" |
120 | | - ] |
121 | | - }, |
122 | | - { |
123 | | - "name": "stdout", |
124 | | - "output_type": "stream", |
125 | | - "text": [ |
126 | | - "11.017099618911743\n" |
127 | | - ] |
128 | | - }, |
129 | | - { |
130 | | - "name": "stdout", |
131 | | - "output_type": "stream", |
132 | | - "text": [ |
133 | | - "10.790261507034302\n" |
134 | | - ] |
135 | | - }, |
136 | | - { |
137 | | - "name": "stdout", |
138 | | - "output_type": "stream", |
139 | | - "text": [ |
140 | | - "9.763712167739868\n" |
141 | | - ] |
142 | | - }, |
143 | | - { |
144 | | - "name": "stdout", |
145 | | - "output_type": "stream", |
146 | | - "text": [ |
147 | | - "9.770148515701294\n" |
148 | | - ] |
149 | | - }, |
150 | | - { |
151 | | - "name": "stdout", |
152 | | - "output_type": "stream", |
153 | | - "text": [ |
154 | | - "9.85509705543518\n" |
155 | | - ] |
156 | | - }, |
157 | | - { |
158 | | - "name": "stdout", |
159 | | - "output_type": "stream", |
160 | | - "text": [ |
161 | | - "15.547704696655273\n" |
162 | | - ] |
| 124 | + "metadata": { |
| 125 | + "ExecuteTime": { |
| 126 | + "end_time": "2025-12-07T09:40:38.122440Z", |
| 127 | + "start_time": "2025-12-07T09:40:37.998462Z" |
163 | 128 | } |
164 | | - ], |
| 129 | + }, |
165 | 130 | "source": [ |
166 | 131 | "from openfermion.chem import MolecularData\n", |
167 | 132 | "from openfermionpyscf import run_pyscf\n", |
|
236 | 201 | " duration = time2 - time1\n", |
237 | 202 | " durations.append(duration)\n", |
238 | 203 | " print(duration)" |
239 | | - ] |
| 204 | + ], |
| 205 | + "outputs": [ |
| 206 | + { |
| 207 | + "ename": "ModuleNotFoundError", |
| 208 | + "evalue": "No module named 'openfermion'", |
| 209 | + "output_type": "error", |
| 210 | + "traceback": [ |
| 211 | + "\u001B[31m---------------------------------------------------------------------------\u001B[39m", |
| 212 | + "\u001B[31mModuleNotFoundError\u001B[39m Traceback (most recent call last)", |
| 213 | + "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[4]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mopenfermion\u001B[39;00m\u001B[34;01m.\u001B[39;00m\u001B[34;01mchem\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m MolecularData\n\u001B[32m 2\u001B[39m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mopenfermionpyscf\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m run_pyscf\n\u001B[32m 4\u001B[39m \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mclassiq\u001B[39;00m\u001B[34;01m.\u001B[39;00m\u001B[34;01mapplications\u001B[39;00m\u001B[34;01m.\u001B[39;00m\u001B[34;01mchemistry\u001B[39;00m\u001B[34;01m.\u001B[39;00m\u001B[34;01mhartree_fock\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[38;5;28;01mimport\u001B[39;00m get_hf_state\n", |
| 214 | + "\u001B[31mModuleNotFoundError\u001B[39m: No module named 'openfermion'" |
| 215 | + ] |
| 216 | + } |
| 217 | + ], |
| 218 | + "execution_count": 4 |
240 | 219 | }, |
241 | 220 | { |
242 | 221 | "cell_type": "code", |
|
294 | 273 | "id": "10", |
295 | 274 | "metadata": {}, |
296 | 275 | "source": [ |
297 | | - "This graph presents the ground state for the $H_{2}$ molecule as a function of the distance between the two hydrogen atoms. Note that both the HF solution and Classiq VQE present decent results around the global minima. For further distances, Classiq VQE stays close to the exact solution while the HF solution gradually deviates. The source of this lack of correspondence is with the lack of flexible correlations within the HF model, which is enabled within the VQE scope.\n", |
| 276 | + "~~ This graph presents the ground state for the $H_{2}$ molecule as a function of the distance between the two hydrogen atoms. Note that both the HF solution and Classiq VQE present decent results around the global minima. For further distances, Classiq VQE stays close to the exact solution while the HF solution gradually deviates. The source of this lack of correspondence is with the lack of flexible correlations within the HF model,~~ which is enabled within the VQE scope.\n", |
298 | 277 | "You can explore more curves, creating graphs for different molecules (even n-dimensional or larger atom assemblies) in a similar fashion.\n" |
299 | 278 | ] |
300 | 279 | } |
|
0 commit comments