Author Topic: Radial distribution  (Read 2560 times)

0 Members and 1 Guest are viewing this topic.

Offline Lim changmin

  • Regular QuantumATK user
  • **
  • Posts: 23
  • Country: kr
  • Reputation: 0
    • View Profile
Radial distribution
« 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()

Offline Lim changmin

  • Regular QuantumATK user
  • **
  • Posts: 23
  • Country: kr
  • Reputation: 0
    • View Profile
Re: Radial distribution
« Reply #1 on: June 12, 2024, 06:54 »
Or are there any other methods that I can use to calculate radial distribution graph?

Offline AsifShah

  • QuantumATK Guru
  • ****
  • Posts: 166
  • Country: in
  • Reputation: 2
    • View Profile
Re: Radial distribution
« Reply #2 on: June 12, 2024, 09:21 »
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"

Offline Lim changmin

  • Regular QuantumATK user
  • **
  • Posts: 23
  • Country: kr
  • Reputation: 0
    • View Profile
Re: Radial distribution
« Reply #3 on: June 12, 2024, 10:37 »
Thank you!!
I finally found MD analyzer that you mentioned!

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5529
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: Radial distribution
« Reply #4 on: July 29, 2024, 23:54 »
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