Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update a new compute angular rdf #884

Merged
merged 18 commits into from
Jan 27, 2025

Conversation

Binxu-Stack
Copy link
Contributor

Add Angular-dependent Radial Distribution Function (Angular RDF)

This PR adds functionality to calculate angular-dependent radial distribution functions (Angular RDF), which extends the traditional RDF by incorporating angular information.

Key Features

  1. Calculates both radial and angular distributions simultaneously
  2. Supports both:
    • Total Angular RDF (all atom pairs)
    • Partial Angular RDF (specific atom type pairs)

Implementation Details

  • Added new class AngularRDF for computing angular-dependent RDF
  • Uses both radial bins (r) and angular bins (θ) for 2D histogram
  • θ range: [-π, π] using atan2 for angle calculation
  • Proper normalization considering:
    • Shell volume: 4π/3(r_outer³ - r_inner³)
    • Angular sector: Δθ/(2π)
    • Number density of each atom type
    • Double counting correction for same atom types

Usage

The Angular RDF can be computed using the following command in the input script:

compute_angular_rdf Rcut Nbins Ntheta interval [atom type1 type2] ...

Parameters:

  • Rcut: Radial cutoff distance
  • Nbins: Number of radial bins
  • Ntheta: Number of angular bins
  • interval: Sampling interval
  • Optional atom type pairs for partial RDF calculation

Output

Results are written to angular_rdf.out with columns:

  1. Radial distance (r)
  2. Angle (θ)
  3. Total RDF
  4. Partial RDFs for each atom type pair (if needed)

Validation

  • Tested with simple atomic configurations
  • Verified normalization against analytical expectations
  • Checked consistency with traditional RDF when integrating over angles

@brucefan1983
Copy link
Owner

Could you change Chinese comment within the code to English?

@brucefan1983 brucefan1983 marked this pull request as draft January 27, 2025 08:43
@Binxu-Stack Binxu-Stack marked this pull request as ready for review January 27, 2025 11:26
@Binxu-Stack
Copy link
Contributor Author

Binxu-Stack commented Jan 27, 2025

I think it is ready.

  • Chinese comment to english
  • doc compiling check
  • code compiling check and test.

@brucefan1983 brucefan1983 merged commit 052ae57 into brucefan1983:master Jan 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants