GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gchemol/gchemol: Graph based CHEMical Object Library

BranchesTags
Open more actions menu

Latest commit

 

History

38 Commits
38 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

gchemol

gchemol is a graph-based chemical object library implemented in Rust programming language. This project is still in early development.

Crates.io

Features

  • Fast and safe codes empowered by Rust.
  • Static build without external dependencies: easy to deploy in HPC environment.
  • Core graph data structure using petgraph
  • Read/write molecules in common chemcial file formats.
  • Linear algebra backed by nalgebra
  • Render molecule in user defined formats by templating with handlebars and tera

How to use

Setup

follow the official guide:

  • Installation · The Rust Programming Language

add gchemol dependency to your Cargo.toml:

[dependencies]
gchemol = "0.1"

Atom

use gchemol::Atom;

// construct from element and position
let a = Atom::new("C", [0.0, 0.0, 0.0]);
let b = Atom::new("C", [1.2, 1.2, 1.2]);

or simply convert from a string:

let a: Atom = "C 1.0 1.0 0.2"
    .parse()
    .expect("atom from string");

Molecule

  1. Creating a molecule manually

    use gchemol::Molecule;
    
    let atoms = [
        Atom::new("C", [ 0.000000,   0.000000,  0.000000]),
        Atom::new("C", [ 0.000000,   0.000000,  1.089000]),
        Atom::new("C", [ 1.026719,   0.000000, -0.363000]),
        Atom::new("C", [-0.513360,  -0.889165, -0.363000]),
        Atom::new("C", [-0.513360,   0.889165, -0.363000])];
    
    // create a molecule from these atoms
    let mut mol = Molecule::from_atoms(atoms);
    
  2. Reading and writing molecules

    use gchemol::io;
    use gchemol::prelude::*;
    use gchemol::Molecule;
    
    // Read an xyz file and write to a Gaussian Input file.
    let mol = Molecule::from_file("path/to/file.xyz")?;
    mol.to_file("methane.gjf")?;
    
    // get the total number of atoms
    let na = mol.natoms();
    // get the total number of bonds
    let nb = mol.nbonds();
    
    // read multiple molecules (trajectory) from a chemical file
    // the number of atoms in different frame could be different
    let mols = io::read("path/to/trajectory.xyz")?;
    

Related projects

  • ase
  • lumol

References

  • Lessons from sixteen years of molecular simulation in Python | Konrad Hinsen's Blog

About

Graph based CHEMical Object Library

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.