Recent Posts

Pages: 1 ... 5 6 [7] 8 9 10
61
Hello,

I am using QuantumATK version X-2025.06 on Linux. I am trying to run a post-processing analysis script in the Editor to calculate the NematicOrderParameter and OrientationFunction for my molecular dynamics simulation results.

However, I am consistently running into a ModuleNotFoundError. I have tried several different import statements based on documentation for various versions, but none seem to work.

The following import attempts have all failed:

from ATK.ForceField import ... (fails with No module named 'ATK')

from ATK.Analyser import ... (fails with No module named 'ATK')

from quantumatk.analysers... import ... (fails with No module named 'quantumatk')

from Analyser import ... (fails with No module named 'Analyser')

This suggests a fundamental issue with how the atkpython environment is finding its own modules in this version.

I have run a diagnostic script to check sys.path, and the output is included in the log file attached below. It seems the main libraries are located in a QATK.zip file, but I cannot find the correct syntax to import from it.

Could you please advise on the correct import syntax for NematicOrderParameter and OrientationFunction for version X-2025.06?

Below is my full analysis script and the latest error log. Thank you for your help.

Code
# ####################################################################
# #                       Required Libraries                         #
# ####################################################################
# This is the import section that is causing a ModuleNotFoundError.
# Trying the most basic import structure for NanoLanguage.
from NanoLanguage import *
from Analyser import NematicOrderParameter, OrientationFunction
from IO import nlread
import numpy
import pylab

# ####################################################################
# #                        !!! SETTINGS !!!                          #
# # PLEASE CAREFULLY EDIT THIS SECTION TO MATCH YOUR SIMULATION      #
# ####################################################################

# 1. Full name of your results file
results_filename = "PureAndC60_8CB_Resorvuar_Pro_NoE_results.py" # Enter your filename here

# 2. LOCAL indices of atoms defining the molecular axis
#    - In the Viewer, select the FIRST 8CB molecule (e.g., atoms with indices 0 to 46).
#    - Note the Index of the atom at the start of the axis (e.g., 5).
#    - Note the Index of the atom at the end of the axis (e.g., 25).
#    - Subtract 1 from these numbers and write them in the list below (e.g., [4, 24]).
axis_atom_indices_local = [4, 24] # THIS IS AN EXAMPLE, YOU MUST ENTER YOUR OWN VALUES!

# 3. Molecule and Atom Counts (Updated based on new information)
first_8cb_atom_index = 0              # 8CB molecules are now at the beginning
atoms_per_8cb_molecule = 47           # Number of atoms in one 8CB molecule (C21H25N)
total_atom_count = 3820               # New total atom count: (80 * 47) + 60

# 4. Temperature range to be analyzed (should be the same as in your simulation)
temperatures = range(293, 315)

# 5. Filenames for the output plots
s_parameter_plot_filename = "S_vs_Temperature_NEW.png"
angular_dist_plot_filename = "Angular_Distribution_NEW.png"

# ####################################################################
# #                  ANALYSIS SCRIPT (DO NOT MODIFY)                 #
# ####################################################################

# Create empty lists to store the results
calculated_s_parameters = []
first_temp_data = None
last_temp_data = None

# Create the list of all 8CB atom indices (excluding C60)
last_8cb_atom_index = first_8cb_atom_index + (80 * atoms_per_8cb_molecule)
all_8cb_indices = list(range(first_8cb_atom_index, last_8cb_atom_index))

print("+" + "-"*50 + "+")
print("ANALYSIS SCRIPT STARTED")
print(f"File: {results_filename}")
print(f"Total Atoms: {total_atom_count}, 8CB Atoms: {len(all_8cb_indices)}")
print("+" + "-"*50 + "+")
print(f"{'Temperature (K)':<15} | {'Order Parameter (S)':<25}")
print("-" * 52)

# Loop over temperatures
for T in temperatures:
    try:
        # Read the final configuration for each temperature from the HDF5 file
        object_id = f'last_image_3_md_reservoir_temperature_{float(T)}.0_Kelvin'
        configuration = nlread(results_filename, object_id=object_id)[0]

        # Calculate Nematic Order Parameter
        analysis_s = NematicOrderParameter(
            configuration=configuration,
            axis_atom_indices=axis_atom_indices_local,
            molecule_indices=[all_8cb_indices]
        )
        s_value = analysis_s.evaluate()
        calculated_s_parameters.append(s_value)
        print(f"{T:<15.1f} | {s_value:<25.4f}")
       
        # Calculate Orientation Function (only for the first and last temperatures for plotting)
        if T == temperatures[0] or T == temperatures[-1]:
            molecular_axes = []
            for i in range(first_8cb_atom_index, last_8cb_atom_index, atoms_per_8cb_molecule):
                atom1_index = i + axis_atom_indices_local[0]
                atom2_index = i + axis_atom_indices_local[1]
               
                pos1 = configuration.cartesianCoordinates()[atom1_index]
                pos2 = configuration.cartesianCoordinates()[atom2_index]
                vector = pos2 - pos1
                unit_vector = vector / numpy.linalg.norm(vector)
                molecular_axes.append(unit_vector)
           
            analysis_angular = OrientationFunction(vectors=molecular_axes, axis=[0,0,1])
            theta, probability = analysis_angular.evaluate()
           
            if T == temperatures[0]:
                first_temp_data = (theta, probability, T)
            else:
                last_temp_data = (theta, probability, T)

    except Exception as e:
        print(f"ERROR: Could not read or analyze data for T={T}K. Check the object_id. Error: {e}")
        calculated_s_parameters.append(None) # Append None in case of an error

print("\nGenerating plots...")

# Plot 1: S Parameter vs. Temperature
pylab.figure()
pylab.plot(temperatures, calculated_s_parameters, 'o-', label='S Parameter')
pylab.xlabel("Temperature (K)")
pylab.ylabel("Nematic Order Parameter (S)")
pylab.title("Order Parameter vs. Temperature")
pylab.ylim(0, 1)
pylab.grid(True)
pylab.legend()
pylab.savefig(s_parameter_plot_filename)
print(f"-> Saved plot: '{s_parameter_plot_filename}'")

# Plot 2: Angular Distribution
pylab.figure()
if first_temp_data:
    theta_first, prob_first, T_first = first_temp_data
    pylab.plot(theta_first * 180 / numpy.pi, prob_first, label=f'{T_first} K (Low Temperature)')
if last_temp_data:
    theta_last, prob_last, T_last = last_temp_data
    pylab.plot(theta_last * 180 / numpy.pi, prob_last, label=f'{T_last} K (High Temperature)')
pylab.xlabel("Angle with Z-axis (Degrees)")
pylab.ylabel("Probability Density")
pylab.title("Molecular Orientational Distribution")
pylab.grid(True)
pylab.legend()
pylab.savefig(angular_dist_plot_filename)
print(f"-> Saved plot: '{angular_dist_plot_filename}'")

print("\nANALYSIS COMPLETE!")
62
Dear sir,

Good morning, Hope this msg finds you well. PFA the snap shot for linearity analysis. How to perform this using quantum atk
Thank you.

If I provide the .opju ( Origin file ) or CSV file of ID-VGS Data of each devices(5 devices) . Can I get those analysis or someone can guide me once.  Then I can do the rest. Thank you.
63
Hello,

I am trying to use the Defect Diffusion workflow template to calculate the dopant diffusion rate in silicon, and I have a few questions about the setup.

I created an MTP using defect training and used that potential for pre-optimization, phonon calculation, and the LCAO calculator for bandgap and reference calculations. I also added an Element Reference Material block for the dopant chemical potential calculation. Since there is no tutorial available for this workflow template, I am not sure if this setup is correct.

The calculation finished successfully and a diffusion rate result was generated. However, when I click on it, the results table appears empty.
Has anyone experienced this issue before or could provide some guidance on how to resolve it?

Thank you in advance!
64
Plugin Development / Re: QATK 2024-09 IV Curve
« Last post by techenthusiast on September 9, 2025, 13:05 »
Yes, use IVCharacteristics, it works fine without gate too.

Not sure about IVCurve, is your problem that you can't read and plot old files?

Facing the same problem. Kindly advise.
65
Dear sir,

Good morning, Hope this msg finds you well. PFA the snap shot for linearity analysis. How to perform this using quantum atk
Thank you.
66
Dear Experts,


'Good morning , HOW TO OBTAIN  gm1, gm2 of a FET(For linearity analysis) from Quantum Atk IV ANALYZER?
Also, Maximum transconductance.....
N.B: Enclosing for reference.

Thank you.

Regards
68
General Questions and Answers / Re: DFT Phonon Transmission
« Last post by AsifShah on September 3, 2025, 20:03 »
Thanks. I will take a look into universal forcefields.
69
General Questions and Answers / Re: RAMAN Spectrum on monolayer MoS2
« Last post by AsifShah on September 3, 2025, 19:43 »
Ah, just follow up. It turned out I had to choose the polarization average rather than polarization in/out. That worked, qualitatively atleast.
70
The RNMED method is implemented as described in these papers:

F. Mueller-Plathe. A simple nonequilibrium molecular dynamics method for calculating the thermal conductivity. J. Chem. Phys., 106(14):6082–6085, 1997https://doi.org/10.1063/1.473271.
C. Nieto-Draghi and J. B. Avalos. Non-equilibrium momentum exchange algorithm for molecular dynamics simulation of heat flow in multicomponent systems. Mol. Phys., 101(14):2303–2307, 2003.https://doi.org/10.1080/0026897031000154338
In short, the energy is exchanged by swapping the momenta of the hottest atom in the heat sink region and the coldest atom in the heat source region. This way an external heat flow between sink and source region is established which is counterbalanced by a heat flux in the configuration from source to sink. When steady-state is reached the external heat flux (which can be measured from the exchanged energy) is equal to the internal heat flux. The thermal conductivity can then be calculated from this heat flux and the temperature gradient using Fourier's law, as described in the tutorial.

We normally recommend a slab-like setup where the top and bottom layers of the surfaces are frozen (after equilibration) and thin heat sink and source regions are assigned adjacent to these frozen caps, e.g. as shown in the attached picture.
These regions can be specified as tags. The thickness should be between 5 and 10 Ang.
The exchange interval should be chosen as big as possible to avoid a too large temperature gradient, and but not too big so that one still gets a measurable gradient. Recommended values are 100 -200. If the temperature gradient becomes too large, then one should increase the value. I have attached an example script of a thermal conductivity simulation.
The heat flux can be extracted when opening the MD-Trajectory in the MD-Analyzer. The measurement "average_heat_current" can be enabled which show the time evolution of the average energy exchanged per time. This can be used to monitor if one has reached a steady-state. The heat flux is obtained by dividing the heat current by the cross-sectional area of the configuration, i.e. the A-B-surface area if the current is along C. The temperature gradient can be obtained from the MD-Analyzer, by plotting the temperature profile and fitting the slope in a selected region as shown in the third attached picture. The tutorial https://docs.quantumatk.com/tutorials/interfacial_thermal_conductance/interfacial_thermal_conductance.html#investigating-the-grain-size-dependence-of-the-thermal-conductivity outlines this, but the functionality displayed there is a bit outdated.

Since this gives you full control over all details, but can be a bit cumbersome to do, we have implemented a convenience function that does combines all these steps and prints the thermal conductivity to the log: https://docs.quantumatk.com/manual/Types/ThermalConductivity/ThermalConductivity.html#thermalconductivity
Pages: 1 ... 5 6 [7] 8 9 10