QuantumATK Forum
QuantumATK => General Questions and Answers => Topic started by: Lim changmin on June 12, 2024, 06:52
-
I am trying to make radial distribution graph from the quantumatk option :
https://docs.quantumatk.com/manual/Types/RadialDistribution/RadialDistribution.html#radialdistribution-c
When I tried to make graph with the python file example above the link, the calculation was finished but nothing appeared.
How can I solve this problem? Here's the code that I made based on the example link.
Thank you!!
md_trajectory = nlread('216csi_TFMC_1.hdf5')[-1]
rdf = RadialDistribution(md_trajectory,
cutoff_radius=3.0*Angstrom,
pair_selection=[Silicon, Silicon])
# Get the bin_centers and the histogram of the radial distribution.
distances = rdf.distances().inUnitsOf(Angstrom)
histogram = rdf.data()
# Plot the data using pylab.
import pylab
pylab.plot(distances, histogram, label='Si RDF')
pylab.xlabel('r (Ang)')
pylab.ylabel('g(r)')
pylab.legend()
pylab.show()
-
Or are there any other methods that I can use to calculate radial distribution graph?
-
You can use inbuilt function in QATK to plot radial and angular distribution.
When you single click on MD trajectory, there will be an option to the right where you can choose "MD Analyzer"
-
Thank you!!
I finally found MD analyzer that you mentioned!
-
Indeed the GUI function is most versatile, but using your script, the plot should pop up as a separate window, but in case you are running in a terminal without a graphical connection, you can replace pylab.show with pylab.savefig("plot.png", dpi=150) to make a plot file