deviceFromBulk

deviceFromBulk(bulk_configuration, electrode_extension_lengths, adjust_cell=True, use_minimal_electrodes=<class 'NL.ComputerScienceUtilities.NLFlag._NLFlag.All'>)

Method that takes a bulk configuration and makes a device configuration.

Parameters:
  • bulk_configuration (BulkConfiguration) – The configuration to create the device from.

  • electrode_extension_lengths (PhysicalQuantity of type length | Automatic) – The desired equivalent electrode extension length of each electrode. If only one length is given, a SurfaceConfiguration will be created, if two lengths or the NLFlag Automatic is given a DeviceConfiguration will be created. If use_minimal_electrodes is False or Transverse, these values also set the electrode lengths in the transport (C-)direction.

  • adjust_cell (bool) – Whether or not to adjust the configuration in the C-direction such that that the electrodes are centered in their own unit cells.
    Default: True.

  • use_minimal_electrodes (All | Transport | Transverse | None) – Try to use the minimal electrodes in: all directions (All), the electron transport (C-) direction (Transport), the transverse (A- and B-) directions (Transverse) or no directions (None). The electrode extension length (i.e. within the central region) will still be set according to the values of electrode_extension_lengths.
    Default: All.

Returns:

The created device or surface configuration.

Return type:

DeviceConfiguration | SurfaceConfiguration

Usage Examples

Create a device from a bulk bar of gold, using minimal electrodes in both the (charge) transport and the transverse directions. The device is extended on the left side by 2.0391 Ang, then retracted on the right side by 2.0391 Ang. The electrode lengths are also adjusted to be 12.23475 Ang and 16.313 Ang on the left and right sides, respectively.

# --- 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 Device from bulk ---
# Create the device configuration.
configuration = deviceFromBulk(
    bulk_configuration=bulk_configuration,
    electrode_extension_lengths=[12.23475, 16.313] * Angstrom,
    adjust_cell=True,
    use_minimal_electrodes=All
)
# Apply the desired extension/retraction to the left side of the central region.
configuration = changeDeviceLength(
    device_configuration=configuration,
    length=2.0391 * Angstrom,
    extreme=Left
)
# Apply the desired extension/retraction to the right side of the central region.
configuration = changeDeviceLength(
    device_configuration=configuration,
    length=-2.0391 * Angstrom,
    extreme=Right
)

deviceFromBulk_example.py

../../../_images/deviceFromBulk_configurations1.png

Fig. 178 a) The input configuration used in the above example. b) The DeviceConfiguration generated from the example.

To create a device with minimal electrodes in only the (charge) transport or transverse directions, use the flags Transport or Transverse, respectively. Example:

# Create a device configuration with minimal electrodes in the transport direction only.
configuration = deviceFromBulk(
    bulk_configuration=bulk_configuration,
    electrode_extension_lengths=[12.23475, 16.313] * Angstrom,
    adjust_cell=True,
    use_minimal_electrodes=Transport
)

# Create a device configuration with minimal electrodes in the transverse direction only.
configuration = deviceFromBulk(
    bulk_configuration=bulk_configuration,
    electrode_extension_lengths=[12.23475, 16.313] * Angstrom,
    adjust_cell=True,
    use_minimal_electrodes=Transverse
)

Notes

  • When using Automatic to find suitable electrode lengths, the function will raise an NLValueError if no suitable electrode lengths could be found.

  • The function will always raise an NLValueError if the sum of electrode lengths exceeds the length of the central region.

  • The function automatically adjusts the tags of the original BulkConfiguration to only apply within the central region of the newly created DeviceConfiguration or SurfaceConfiguraton.

  • This function can also be used to create a SurfaceConfiguraton if only one electrode length is given, but will not add the region of vacuum at the surface. To properly create a SurfaceConfiguraton, use the function surfaceFromBulk().