# Load the configuration
configuration = nlread("equilibrated_pdms.hdf5")[0]

# Create and set the calculator
builder = DreidingPotentialBuilder()
calculator = SoftMatterCalculator(builder, use_lennard_jones_pme=True, assign_atom_types=True)
configuration.setCalculator(calculator)

# Set the simulation
atomic_constraints = [FixCenterOfMass()]
method = NVTNoseHoover(initial_velocity=ConfigurationVelocities())
simulation = SoftMatterDynamicsSimulation(configuration, method, atomic_constraints=atomic_constraints)
simulation.setLogging(1000)
simulation.setTrajectory(1000, "pdms_trajectory.hdf5")

# Set the temperature profile
temperature_profile = SimulationTemperatureProfile(
    initial_value=300*Kelvin,
    initial_gradient=1000*Kelvin
)
temperature_profile.addQuantityValue(0.3, 600*Kelvin, gradient=0*Kelvin)
temperature_profile.addQuantityValue(0.7, 600*Kelvin, gradient=-1000*Kelvin)

# Run the simulation
simulation.simulate(100000, profiles=[temperature_profile])
