|
70 | 70 | },
|
71 | 71 | {
|
72 | 72 | "cell_type": "code",
|
73 |
| - "execution_count": 5, |
| 73 | + "execution_count": 1, |
74 | 74 | "metadata": {},
|
75 |
| - "outputs": [], |
| 75 | + "outputs": [ |
| 76 | + { |
| 77 | + "data": { |
| 78 | + "application/vnd.jupyter.widget-view+json": { |
| 79 | + "model_id": "ff2fca2da3f648a48d4eced11b3509ef", |
| 80 | + "version_major": 2, |
| 81 | + "version_minor": 0 |
| 82 | + }, |
| 83 | + "text/plain": [] |
| 84 | + }, |
| 85 | + "metadata": {}, |
| 86 | + "output_type": "display_data" |
| 87 | + } |
| 88 | + ], |
76 | 89 | "source": [
|
77 | 90 | "import matplotlib.pyplot as plt\n",
|
78 | 91 | "%matplotlib widget\n",
|
|
91 | 104 | },
|
92 | 105 | {
|
93 | 106 | "cell_type": "code",
|
94 |
| - "execution_count": 6, |
| 107 | + "execution_count": 2, |
95 | 108 | "metadata": {},
|
96 |
| - "outputs": [], |
| 109 | + "outputs": [ |
| 110 | + { |
| 111 | + "ename": "NameError", |
| 112 | + "evalue": "name 'target_k' is not defined", |
| 113 | + "output_type": "error", |
| 114 | + "traceback": [ |
| 115 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 116 | + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", |
| 117 | + "Cell \u001b[0;32mIn[2], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m traj\u001b[38;5;241m=\u001b[39mTrajectory(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdummy.traj\u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mw\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 2\u001b[0m traj\u001b[38;5;241m.\u001b[39mwrite(Atoms(\u001b[38;5;241m2\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mC\u001b[39m\u001b[38;5;124m'\u001b[39m,[[\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m0\u001b[39m],[\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m1\u001b[39m]]))\n\u001b[0;32m----> 3\u001b[0m handler\u001b[38;5;241m=\u001b[39m\u001b[43mNGLTrajectory\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtrajectory\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mTrajectory\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mdummy.traj\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mr\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4\u001b[0m handler\u001b[38;5;241m.\u001b[39mview\u001b[38;5;241m.\u001b[39mstage\u001b[38;5;241m.\u001b[39mset_parameters(mouse_preset\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpymol\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 6\u001b[0m handler\u001b[38;5;241m.\u001b[39mview\u001b[38;5;241m.\u001b[39m_js(\u001b[38;5;124m\"\"\"\u001b[39m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;124mthis.mouseOverDisplay(\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mblock\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m)\u001b[39m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;124mvar container = this.stage.viewer.container\u001b[39m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;124m }, false);\u001b[39m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;124m\"\"\"\u001b[39m)\n", |
| 118 | + "File \u001b[0;32m~/osscar_ssh_v2/quantum-mechanics/notebook/lattice-vibration/NGLTrajectoryClass.py:79\u001b[0m, in \u001b[0;36mNGLTrajectory.__init__\u001b[0;34m(self, trajectory)\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[38;5;66;03m#target_k=np.pi/2\u001b[39;00m\n\u001b[1;32m 78\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mka_array \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mlinspace(\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m2\u001b[39m \u001b[38;5;241m*\u001b[39m np\u001b[38;5;241m.\u001b[39mpi, \u001b[38;5;241m2\u001b[39m \u001b[38;5;241m*\u001b[39m np\u001b[38;5;241m.\u001b[39mpi, \u001b[38;5;241m101\u001b[39m)\n\u001b[0;32m---> 79\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39midx \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(\u001b[38;5;241m101\u001b[39m\u001b[38;5;241m*\u001b[39m(\u001b[43mtarget_k\u001b[49m\u001b[38;5;241m+\u001b[39m\u001b[38;5;241m2\u001b[39m\u001b[38;5;241m*\u001b[39mnp\u001b[38;5;241m.\u001b[39mpi)\u001b[38;5;241m/\u001b[39m(\u001b[38;5;241m4\u001b[39m\u001b[38;5;241m*\u001b[39mnp\u001b[38;5;241m.\u001b[39mpi)) \u001b[38;5;66;03m# idx corresponding to ka=0\u001b[39;00m\n\u001b[1;32m 80\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39midx \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m50\u001b[39m \u001b[38;5;66;03m# idx corresponding to ka=0\u001b[39;00m\n\u001b[1;32m 81\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptic \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n", |
| 119 | + "\u001b[0;31mNameError\u001b[0m: name 'target_k' is not defined" |
| 120 | + ] |
| 121 | + } |
| 122 | + ], |
97 | 123 | "source": [
|
98 | 124 | "traj=Trajectory('dummy.traj','w')\n",
|
99 | 125 | "traj.write(Atoms(2*'C',[[0,0,0],[1,1,1]]))\n",
|
|
215 | 241 | },
|
216 | 242 | {
|
217 | 243 | "cell_type": "code",
|
218 |
| - "execution_count": 7, |
| 244 | + "execution_count": null, |
219 | 245 | "metadata": {},
|
220 |
| - "outputs": [ |
221 |
| - { |
222 |
| - "data": { |
223 |
| - "text/html": [ |
224 |
| - "<style>\n", |
225 |
| - ".box_style{\n", |
226 |
| - " border : 2px solid red;\n", |
227 |
| - "}\n", |
228 |
| - "</style>\n" |
229 |
| - ], |
230 |
| - "text/plain": [ |
231 |
| - "<IPython.core.display.HTML object>" |
232 |
| - ] |
233 |
| - }, |
234 |
| - "metadata": {}, |
235 |
| - "output_type": "display_data" |
236 |
| - } |
237 |
| - ], |
| 246 | + "outputs": [], |
238 | 247 | "source": [
|
239 | 248 | "%%html\n",
|
240 | 249 | "<style>\n",
|
|
246 | 255 | },
|
247 | 256 | {
|
248 | 257 | "cell_type": "code",
|
249 |
| - "execution_count": 8, |
| 258 | + "execution_count": null, |
250 | 259 | "metadata": {
|
251 | 260 | "scrolled": true
|
252 | 261 | },
|
253 |
| - "outputs": [ |
254 |
| - { |
255 |
| - "data": { |
256 |
| - "application/vnd.jupyter.widget-view+json": { |
257 |
| - "model_id": "d7b84f9985bc41639601a74613eceb9e", |
258 |
| - "version_major": 2, |
259 |
| - "version_minor": 0 |
260 |
| - }, |
261 |
| - "text/plain": [ |
262 |
| - "VBox(children=(Tab(children=(HBox(children=(VBox(children=(HBox(children=(HTMLMath(value='Atomic chain type', …" |
263 |
| - ] |
264 |
| - }, |
265 |
| - "metadata": {}, |
266 |
| - "output_type": "display_data" |
267 |
| - }, |
268 |
| - { |
269 |
| - "data": { |
270 |
| - "application/vnd.jupyter.widget-view+json": { |
271 |
| - "model_id": "1ab3a0ba628041beab40ecd5efee8549", |
272 |
| - "version_major": 2, |
273 |
| - "version_minor": 0 |
274 |
| - }, |
275 |
| - "text/plain": [ |
276 |
| - "HBox(children=(NGLWidget(max_frame=50),), layout=Layout(align_items='center', display='flex', flex_flow='colum…" |
277 |
| - ] |
278 |
| - }, |
279 |
| - "metadata": {}, |
280 |
| - "output_type": "display_data" |
281 |
| - }, |
282 |
| - { |
283 |
| - "ename": "TypeError", |
284 |
| - "evalue": "loop() takes 1 positional argument but 2 were given", |
285 |
| - "output_type": "error", |
286 |
| - "traceback": [ |
287 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
288 |
| - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", |
289 |
| - "Cell \u001b[0;32mIn[8], line 18\u001b[0m\n\u001b[1;32m 14\u001b[0m view\u001b[38;5;241m.\u001b[39m_run_on_another_thread(do)\n\u001b[1;32m 17\u001b[0m hv_thread\u001b[38;5;241m=\u001b[39mhandler\u001b[38;5;241m.\u001b[39mview\u001b[38;5;241m.\u001b[39m_run_on_another_thread(init_view)\n\u001b[0;32m---> 18\u001b[0m \u001b[43mloop\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43mview\u001b[49m\u001b[43m)\u001b[49m\n", |
290 |
| - "\u001b[0;31mTypeError\u001b[0m: loop() takes 1 positional argument but 2 were given" |
291 |
| - ] |
292 |
| - }, |
293 |
| - { |
294 |
| - "name": "stderr", |
295 |
| - "output_type": "stream", |
296 |
| - "text": [ |
297 |
| - "Exception in thread Thread-10 (init_view):\n", |
298 |
| - "Traceback (most recent call last):\n", |
299 |
| - " File \"/usr/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n", |
300 |
| - " self.run()\n", |
301 |
| - " File \"/home/taylor/venvs/nb_testing/lib/python3.10/site-packages/ipykernel/ipkernel.py\", line 766, in run_closure\n", |
302 |
| - " _threading_Thread_run(self)\n", |
303 |
| - " File \"/usr/lib/python3.10/threading.py\", line 953, in run\n", |
304 |
| - " self._target(*self._args, **self._kwargs)\n", |
305 |
| - " File \"/tmp/ipykernel_27490/1732612826.py\", line 14, in init_view\n", |
306 |
| - "NameError: name 'do' is not defined\n" |
307 |
| - ] |
308 |
| - } |
309 |
| - ], |
| 262 | + "outputs": [], |
310 | 263 | "source": [
|
311 | 264 | "display(actions,HBox([handler.view],layout=layout).add_class(\"box_style\"))\n",
|
312 | 265 | "stop = False\n",
|
|
0 commit comments