This file is indexed.

/usr/share/python-ase/doc/ase/surface.rst is in python-ase-doc 3.9.1.4567-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
.. _lattice-surface-section:

========
Surfaces
========

.. module:: ase.lattice.surface


Common surfaces
===============

A number of utility functions are provided to set up
the most common surfaces, to add vacuum layers, and to add adsorbates
to a surface.  In general, all surfaces can be set up with
the modules described in the section :ref:`general-crystal-section`, but these
utility functions make common tasks easier.



Example
-------

To setup an Al(111) surface with a hydrogen atom adsorbed in an on-top
position::

  from ase.lattice.surface import fcc111
  slab = fcc111('Al', size=(2,2,3), vacuum=10.0)

This will produce a slab 2x2x3 times the minimal possible size, with a
(111) surface in the z direction.  A 10 Å vacuum layer is added on
each side.

To set up the same surface with with a hydrogen atom adsorbed in an on-top
position 1.5 Å above the top layer::

  from ase.lattice.surface import fcc111, add_adsorbate
  slab = fcc111('Al', size=(2,2,3))
  add_adsorbate(slab, 'H', 1.5, 'ontop')
  slab.center(vacuum=10.0, axis=2)

Note that in this case is is probably not meaningful to use the vacuum
keyword to fcc111, as we want to leave 10 Å of vacuum *after* the
adsorbate has been added. Instead, the :meth:`~ase.atoms.Atoms.center` method
of the :class:`~ase.atoms.Atoms` is used
to add the vacuum and center the system.

The atoms in the slab will have tags set to the layer number: First layer
atoms will have tag=1, second layer atoms will have tag=2, and so on.
Adsorbates get tag=0:

>>> print atoms.get_tags()
[3 3 3 3 2 2 2 2 1 1 1 1 0]

This can be useful for setting up :mod:`ase.constraints` (see
:ref:`diffusion_tutorial`).


Utility functions for setting up surfaces
-----------------------------------------

All the functions setting up surfaces take the same arguments.

*symbol*:
  The chemical symbol of the element to use.

*size*:
  A tuple giving the system size in units of the minimal unit cell.

*a*:
  (optional) The lattice constant.  If specified, it overrides the
  expermental lattice constant of the element.  Must be specified if
  setting up a crystal structure different from the one found in
  nature.

*c*:
  (optional) Extra HCP lattice constant.  If specified, it overrides the
  expermental lattice constant of the element.  Can be specified if
  setting up a crystal structure different from the one found in
  nature and an ideal `c/a` ratio is not wanted (`c/a=(8/3)^{1/2}`).

*vacuum*:
  The thickness of the vacuum layer.  The specified amount of
  vacuum appears on both sides of the slab.  Default value is None,
  meaning not to add any vacuum.  In that case a "vacuum" layer equal
  to the interlayer spacing will be present on the upper surface of
  the slab.  Specify ``vacuum=0.0`` to remove it.

*orthogonal*:
  (optional, not supported by all functions). If specified and true,
  forces the creation of a unit cell with orthogonal basis vectors.
  If the default is such a unit cell, this argument is not supported.

Each function defines a number of standard adsorption sites that can
later be used when adding an adsorbate with
:func:`ase.lattice.surface.add_adsorbate`.


The following functions are provided
````````````````````````````````````

.. function:: fcc100(symbol, size, a=None, vacuum=0.0)
.. function:: fcc110(symbol, size, a=None, vacuum=0.0)
.. function:: bcc100(symbol, size, a=None, vacuum=0.0)
.. function:: hcp10m10(symbol, size, a=None, c=None, vacuum=0.0)
.. function:: diamond100(symbol, size, a=None, vacuum=0.0)

These allways give orthorhombic cells:

==========  ============
fcc100      |fcc100|
fcc110      |fcc110|
bcc100      |bcc100|
hcp10m10    |hcp10m10|
diamond100  |diamond100|
==========  ============


.. function:: fcc111(symbol, size, a=None, vacuum=0.0, orthogonal=False)
.. function:: fcc111_root(symbol, root, size, a=None, vacuum=0.0, orthogonal=False, search_space=(20, 20))
.. function:: fcc211(symbol, size, a=None, vacuum=0.0, orthogonal=True)
.. function:: bcc110(symbol, size, a=None, vacuum=0.0, orthogonal=False)
.. function:: bcc111(symbol, size, a=None, vacuum=0.0, orthogonal=False)
.. function:: hcp0001(symbol, size, a=None, c=None, vacuum=0.0, orthogonal=False)
.. function:: diamond111(symbol, size, a=None, vacuum=0.0, orthogonal=False)

These can give both non-orthorhombic and orthorhombic cells:

===========  ===============  ===============
fcc111       |fcc111|         |fcc111o|
fcc111_root  varies on root   not_implemented
fcc211       not implemented  |fcc211o|
bcc110       |bcc110|         |bcc110o|
bcc111       |bcc111|         |bcc111o|
hcp0001      |hcp0001|        |hcp0001o|
diamond111   |diamond111|     not implemented
===========  ===============  ===============

The adsorption sites are marked with:

=======  ========  =====  =====  ========  ===========  ==========
ontop    hollow    fcc    hcp    bridge    shortbridge  longbridge
|ontop|  |hollow|  |fcc|  |hcp|  |bridge|  |bridge|     |bridge|
=======  ========  =====  =====  ========  ===========  ==========

.. |ontop|    image:: ontop-site.png
.. |hollow|   image:: hollow-site.png
.. |fcc|      image:: fcc-site.png
.. |hcp|      image:: hcp-site.png
.. |bridge|   image:: bridge-site.png
.. |fcc100|   image:: fcc100.png
.. |fcc110|   image:: fcc110.png
.. |bcc100|   image:: bcc100.png
.. |fcc111|   image:: fcc111.png
.. |bcc110|   image:: bcc110.png
.. |bcc111|   image:: bcc111.png
.. |hcp0001|  image:: hcp0001.png
.. |fcc111o|  image:: fcc111o.png
.. |fcc211o|  image:: fcc211o.png
.. |bcc110o|  image:: bcc110o.png
.. |bcc111o|  image:: bcc111o.png
.. |hcp0001o| image:: hcp0001o.png
.. |hcp10m10| image:: hcp10m10.png
.. |diamond100| image:: diamond100.png
.. |diamond111| image:: diamond111.png


This can be used for :mol:`MX2` 2D structures such as :mol:`MoS2`:

.. autofunction:: mx2

.. image:: mx2.png


Adding new utility functions
````````````````````````````

If you need other surfaces than the ones above, the easiest is to look
in the source file surface.py, and adapt one of the existing
functions.  *Please* contribute any such function that you make
either by checking it into SVN or by mailing it to the developers.


Adding adsorbates
-----------------

After a slab has been created, a vacuum layer can be added.  It is
also possible to add one or more adsorbates.

.. autofunction:: ase.lattice.surface.add_adsorbate
.. autofunction:: ase.lattice.surface.add_vacuum


.. _general-surface-section:

Create specific non-common surfaces
===================================

.. versionadded:: 3.5.2

In addition to the most normal surfaces, a function has been
constructed to create more uncommon surfaces that one could be
interested in.  It is constructed upon the Miller Indices defining the
surface and can be used for both fcc, bcc and hcp structures.  The
theory behind the implementation can be found here:
:download:`general_surface.pdf`.

.. autofunction:: ase.lattice.surface.surface


Example
-------

To setup a Au(211) surface with 9 layers and 10 Å of vacuum:

.. literalinclude:: general_surface.py
    :lines: 2-4

This is the easy way, where you use the experimental lattice constant
for gold bulk structure.  You can write::

    from ase.visualize import view
    view(s1)

or simply ``s1.edit()`` if you want to see and rotate the structure.

.. image:: s1.png

Next example is a molybdenum bcc(321) surface where we decide what
lattice constant to use:

.. literalinclude:: general_surface.py
    :lines: 6-9

.. image:: s2.png

As the last example, creation of alloy surfaces is also very easily
carried out with this module.  In this example, two :mol:`Pt_3Rh`
fcc(211) surfaces will be created:

.. literalinclude:: general_surface.py
    :lines: 11-25

|s3| |s4|

.. |s3| image:: s3.png
.. |s4| image:: s4.png