2.7.1. prismatique.scan.generate_probe_positions
- generate_probe_positions(sample_specification, scan_config=None, filename=None, skip_validation_and_conversion=False)[source]
Generate the probe positions specified by a given scanning configuration for a given sample.
- Parameters:
- sample_specification
prismatique.sample.ModelParams|prismatique.sample.PotentialSliceSubsetIDs|prismatique.sample.SMatrixSubsetIDs|prismatique.sample.PotentialSliceAndSMatrixSubsetIDs The simulation parameters specifying the sample model.
If
sample_specificationis of the typeprismatique.sample.ModelParams, thensample_specificationsspecifies sample model parameters that are used to construct the model from scratch, i.e. the potential slices for each frozen phonon configuration subset are calculated from said model parameters. See the documentation for the classesprismatique.discretization.Paramsandprismatique.thermal.Paramsfor discussions on potential slices and frozen phonon configuration subsets respectively. Note that of parameters stored insample_specification, only the following are used:sample_specification
atomic_coords_filename
unit_cell_tiling
Otherwise, if
sample_specificationis an instance of the classprismatique.sample.PotentialSliceSubsetIDs, the classprismatique.sample.SMatrixSubsetIDs, or the classprismatique.sample.PotentialSliceAndSMatrixSubsetIDs, thensample_specificationspecifies a set of files, where each file stores either the pre-calculated potential slices or \(S\)-matrices for a frozen phonon configuration subset. See the documentation for the aforementioned classes for further discussions on specifying pre-calculated objects. See the documentation for the subpackageprismatique.stemfor a discussion on \(S\)-matrices.- scan_configarray_like (float, shape=(
num_positions,2)) |prismatique.scan.rectangular.Params| str | None, optional If
scan_configis a real-valued two-column matrix, then it specifies a set of probe positions, wherescan_config[i][0]andscan_config[i][1]specify respectively the \(x\)- and \(y\)-coordinates of the probe position indexed byi, in units of angstroms, with0<=i<num_positionsandnum_positionsbeing the number of probe positions. Ifscan_configis of the typeprismatique.scan.rectangular.Params, then it specifies a rectangular grid-like pattern of probe positions. See the documentation for this class for more details. Ifscan_configis a string, thenscan_configis a path to a file that specifies a set of probe positions. The file must be encoded as ASCII text (UTF-8). The file should be formatted as follows: the first line can be whatever header the user desires, i.e. the first line is treated as a comment; each subsequent line except for the last is of the form “x y”, where “x” and “y” are the \(x\)- and \(y\)-coordinates of a probe position, in units of angstroms; and the last line in the file should be “-1”.Since periodic boundaries conditions (PBCs) are assumed in the \(x\)- and \(y\)-dimensions, \(x\)- and \(y\)-coordinates can take on any real numbers. If
scan_configis set to None, [i.e. the default value], then the probe is to be scanned across the entire unit cell of the simulation, in steps of 0.25 angstroms in both the \(x\)- and \(y\)-directions.- filenamestr | None, optional
If
filenameis set to a valid filename, then the generated probe positions are saved to a file with the filenamefilename. The file is formatted as follows: the first line is “probe positions in units of Å”; each subsequent line except for the last is of the form “x y”, where “x” and “y” are the \(x\)- and \(y\)-coordinates of a probe position, in units of angstroms; and the last line in the file is “-1”. Otherwise, iffilenameis set to None [i.e. the default value], then the generated probe positions are not saved to file.- skip_validation_and_conversionbool, optional
If
skip_validation_and_conversionis set toFalse, then validations and conversions are performed on the above parameters.Otherwise, if
skip_validation_and_conversionis set toTrue, no validations and conversions are performed on the above parameters. This option is desired primarily when the user wants to avoid potentially expensive validation and/or conversion operations.
- sample_specification
- Returns:
- probe_positionsarray_like (float, shape=(
num_positions,2)) If we let
num_positionsbe the number of probe positions, thenprobe_positions[i][0]andprobe_positions[i][1]are the \(x\)- and \(y\)-coordinates of theith probe position in units of Å, where0<=i<num_positions.
- probe_positionsarray_like (float, shape=(