|
6 | 6 | "metadata": {},
|
7 | 7 | "source": [
|
8 | 8 | "# `widget-bzvisualizer`: A Jupyter widget to visualize the 1st Brillouin zone and band paths\n",
|
9 |
| - "**Source code**: https://github.com/osscar-org/widget-bzvisualizer\n", |
| 9 | + "\n", |
| 10 | + "**Source code**: [https://github.com/osscar-org/widget-bzvisualizer](https://github.com/osscar-org/widget-bzvisualizer) \n", |
10 | 11 | "\n",
|
11 | 12 | "**Introduction**: A Jupyter widget to plot the 1st Brillouin zone and band paths. \n",
|
12 | 13 | "It uses the Javascript package [tools-seekpath](https://seekpath.readthedocs.io) developed \n",
|
|
52 | 53 | "metadata": {},
|
53 | 54 | "outputs": [],
|
54 | 55 | "source": [
|
55 |
| - "lattice = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])\n", |
| 56 | + "from widget_bzvisualizer import BZVisualizer\n", |
| 57 | + "\n", |
| 58 | + "cell = [\n", |
| 59 | + " [5.0, 0.0, 0.0],\n", |
| 60 | + " [0.0, 5.0, 0.0],\n", |
| 61 | + " [0.0, 0.0, 5.0],\n", |
| 62 | + "]\n", |
| 63 | + "# atomic coordinates in terms of unit vectors\n", |
| 64 | + "rel_coords = [[0.0, 0.0, 0.0]]\n", |
| 65 | + "# element numbers of atoms\n", |
| 66 | + "atom_numbers = [6]\n", |
56 | 67 | "\n",
|
57 |
| - "w = BZVisualizer(lattice, [[0.0, 0.0, 0.0]], [1], True)\n", |
58 |
| - "display(w)" |
| 68 | + "bz = BZVisualizer(\n", |
| 69 | + " cell, rel_coords, atom_numbers,\n", |
| 70 | + " width=\"100%\", height=\"400px\",\n", |
| 71 | + " show_axes=True,\n", |
| 72 | + " show_bvectors=True,\n", |
| 73 | + " show_pathpoints=True,\n", |
| 74 | + " disable_interact_overlay=True,\n", |
| 75 | + ")\n", |
| 76 | + "display(bz)" |
59 | 77 | ]
|
60 | 78 | },
|
61 | 79 | {
|
|
86 | 104 | "metadata": {},
|
87 | 105 | "outputs": [],
|
88 | 106 | "source": [
|
89 |
| - "w.kpts = (monkhorst_pack((8, 8, 8))*2*np.pi).tolist()" |
| 107 | + "bz.kpts = (monkhorst_pack((8, 8, 8))*2*np.pi).tolist()" |
90 | 108 | ]
|
91 | 109 | },
|
92 | 110 | {
|
|
95 | 113 | "id": "stretch-animal",
|
96 | 114 | "metadata": {},
|
97 | 115 | "outputs": [],
|
| 116 | + "source": [ |
| 117 | + "bz.kpts" |
| 118 | + ] |
| 119 | + }, |
| 120 | + { |
| 121 | + "cell_type": "code", |
| 122 | + "execution_count": null, |
| 123 | + "id": "5157f61b-e6da-4167-83f8-771d3eea6e0b", |
| 124 | + "metadata": {}, |
| 125 | + "outputs": [], |
98 | 126 | "source": []
|
99 | 127 | }
|
100 | 128 | ],
|
|
114 | 142 | "name": "python",
|
115 | 143 | "nbconvert_exporter": "python",
|
116 | 144 | "pygments_lexer": "ipython3",
|
117 |
| - "version": "3.9.7" |
| 145 | + "version": "3.11.5" |
118 | 146 | }
|
119 | 147 | },
|
120 | 148 | "nbformat": 4,
|
|
0 commit comments