checkNumberOfRepetitions

checkNumberOfRepetitions(configuration, max_interaction_range=None)

Method for automatic detection of the number of repetitions.

@param configuration : The configuration for which the repetitions should be calculated. @type : BulkConfiguration | MoleculeConfiguration | DeviceConfiguration.

@param max_interaction_range : The maximum range of the interactions. @type : PhysicalQuantity of type length. @default : None (pre-defined interaction range)

@return Tuple with the number of repetitions.

Usage Examples

Calculate and print the automatically detected repetition for a bulk configuration.

# -------------------------------------------------------------
# Bulk configuration
# -------------------------------------------------------------

# Set up lattice
lattice = FaceCenteredCubic(5.4306*Angstrom)

# Define elements
elements = [Silicon, Silicon]

# Define coordinates
fractional_coordinates = [[ 0.  ,  0.  ,  0.  ],
                          [ 0.25,  0.25,  0.25]]

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    fractional_coordinates=fractional_coordinates
    )


# Calculate the automatically detected repetitions.
repetitions = checkNumberOfRepetitions(bulk_configuration)

# Print the result.
print(repetitions)


# Calculate the automatically detected repetitions, when a maximum interaction
# range is specified.
repetitions = checkNumberOfRepetitions(bulk_configuration,
                                       max_interaction_range=10*Angstrom)

# Print the result.
print(repetitions)



Note that the repetition can also be calculated, when a maximum interaction range is specified as shown in the last two lines.