surfaceFromBulk¶
- surfaceFromBulk(bulk_configuration, electrode_extension_length, vacuum_length)¶
Method that takes a bulk configuration and makes a surface configuration with some vacuum at the surface.
- Parameters:
bulk_configuration (
BulkConfiguration
) – The configuration to modify.electrode_extension_length (PhysicalQuantity of type length | Automatic) – The desired equivalent electrode extension length of the left electrode.
vacuum_length (PhysicalQuantity of type length) – The desired vacuum length.
- Returns:
The surface configuration with adjusted vacuum.
- Return type:
Usage Examples¶
Create a surface from a bulk bar of gold, with 10 Ang of vacuum at the surface.
The surface is also retracted by 4.0782 Ang (always on the left side for
SurfaceConfiguration
) and the electrode length is adjusted to 12.23475 Ang.
# --- Create input configuration ---
# Set up lattice
vector_a = [4.07825, 0.0, 0.0] * Angstrom
vector_b = [0.0, 4.07825, 0.0] * Angstrom
vector_c = [0.0, 0.0, 32.626] * Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)
# Define elements
elements = [Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold,
Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold, Gold]
# Define coordinates
fractional_coordinates = [[ 0. , 0. , 0. ],
[ 0. , 0. , 0.125 ],
[ 0. , 0. , 0.25 ],
[ 0. , 0. , 0.375 ],
[ 0. , 0. , 0.5 ],
[ 0. , 0. , 0.625 ],
[ 0. , 0. , 0.75 ],
[ 0. , 0. , 0.875 ],
[ 0.5 , 0.5 , 0. ],
[ 0.5 , 0.5 , 0.125 ],
[ 0.5 , 0.5 , 0.25 ],
[ 0.5 , 0.5 , 0.375 ],
[ 0.5 , 0.5 , 0.5 ],
[ 0.5 , 0.5 , 0.625 ],
[ 0.5 , 0.5 , 0.75 ],
[ 0.5 , 0.5 , 0.875 ],
[ 0.5 , 0. , 0.0625],
[ 0.5 , 0. , 0.1875],
[ 0.5 , 0. , 0.3125],
[ 0.5 , 0. , 0.4375],
[ 0.5 , 0. , 0.5625],
[ 0.5 , 0. , 0.6875],
[ 0.5 , 0. , 0.8125],
[ 0.5 , 0. , 0.9375],
[ 0. , 0.5 , 0.0625],
[ 0. , 0.5 , 0.1875],
[ 0. , 0.5 , 0.3125],
[ 0. , 0.5 , 0.4375],
[ 0. , 0.5 , 0.5625],
[ 0. , 0.5 , 0.6875],
[ 0. , 0.5 , 0.8125],
[ 0. , 0.5 , 0.9375]]
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)
# --- Create Surface from bulk ---
# Create a surface configuration with some vacuum.
configuration = surfaceFromBulk(
bulk_configuration=bulk_configuration,
electrode_extension_length=12.23475 * Angstrom,
vacuum_length=10 * Angstrom
)
# Apply the desired extension/retraction to the left side of the central region.
configuration = changeDeviceLength(
device_configuration=configuration,
length=-4.0782 * Angstrom,
extreme=Left
)

Fig. 190 a) The input configuration used in the above example. b) The SurfaceConfiguration generated from the example.¶
Notes¶
This function facilitates scripting the creation of a surface, mainly by setting up the vacuum at the surface of the input bulk configuration, though
deviceFromBulk()
is called internally to generate the actualSurfaceConfiguration
.When using Automatic to find suitable left electrode length, the function will raise an NLValueError if no suitable length could be found.