Calculates the Landauer transmission and current density for a given molecule in a junction. The electrodes are assumed to be two dihydrogens.
It uses a Rust script to calculate the gradient. The source code can be grabbed here
Due to some API changes of GPAW (specifically the change from dump_hamiltonian_parallel
to dump_hamiltonian_and_overlap
), the latest supported version of GPAW is 20.1.0
The following assumes you're running the calculation on a system that uses SLURM. You need two things in the same folder: a file named hh_junc.traj that contains the junction and a file named config that, as a minimum, contains the indices for the top and bottom atoms on the z-axis. You then run the following command
current_submit <queue> <CPUs> <mem in GB> <optionally a job name>
To use calc_current, you need to generate a junction using junction.py. It will look for .xyz
file in the same folder as itself.
The script attaches two dihydrogens at specified locations at the molecule in the .xyz
. It creates a hh_junc.traj
which will subsequently be used for calculating the current density.
To modify where the electrodes are attached to the molecule, you'll have to edit start_indices
, end_indices
and the A
, D1
, and D2
parameters of create_junction()
. The first electrode is attached at a dihedral angle of D1
formed from the three indices of start_indices
and D1
. Likewise for the second electrode, end_indices
, and D2
.
The current density calculation requires a configuration file that specifies at least the top and bottom atoms of the molecule, which define the z-axis and are used to color the arrows by their z-component and φ-component. A minimal configuration file looks like this:
top_atom=index_of_top_atom
bottom_atom=index_of_bottom_atom
You can use ASE with the following command to view your molecule and the indices of each atom:
ase gui molecule.xyz
ASE can also show .traj files so you can plot the junction with the following command
ase gui hh_junc.traj
Other options for the config file include the following (the default value is shown):
ef=0
The energy at which to calculate the current density. The default is the midpoint between the energy of the HOMO and the LUMOfunctional=pbe
The functional that is used to calculate the electronic structure.h_spacing=0.2
Specifies the grid spacing in Å that has to be used for the realspace representation of the smooth wave functionscharge=0
Charge of the moleculecutoff=20
How many arrows to include in the plot of the current density. A value of 20 corresponds to not plotting arrows smaller than 5% of the largest arrow.
Please feel free to open an issue if you have any questions or notice that something might be wrong!
Otherwise, my contact information can be found here