Skip to content

Instantly share code, notes, and snippets.

View janash's full-sized avatar

Jessica A. Nash janash

View GitHub Profile
@janash
janash / cubic_lattice.py
Last active August 4, 2023 20:21
cubic lattice
def generate_cubic_lattice(num_atoms, density):
"""
Generate points on a cubic lattice using a desired final density.
Parameters
----------
num_atoms: int
The number of atoms to place on the lattice.
density: float
The desired system density.
"""
Stats functions
"""
def mean(my_list):
my_sum = sum(my_list)
my_average = my_sum / len(my_list)
import os
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib notebook
def calculate_distance(rA, rB):
# This function calculates the distance between two points given as numpy arrays.
xdata ydata
-10.0 1.2
-9.0 4.2
-8.0 6.7
-7.0 8.3
-6.0 10.6
-5.0 11.7
-4.0 13.5
-3.0 14.5
-2.0 15.7
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
"AtomicNumber","Symbol","Name","AtomicMass","CPKHexColor","ElectronConfiguration","Electronegativity","AtomicRadius","IonizationEnergy","ElectronAffinity","OxidationStates","StandardState","MeltingPoint","BoilingPoint","Density","GroupBlock","YearDiscovered"
1,"H","Hydrogen",1.0080,"FFFFFF","1s1",2.2,120,13.598,0.754,"+1, -1","Gas",13.81,20.28,0.00008988,"Nonmetal",1766
2,"He","Helium",4.00260,"D9FFFF","1s2","",140,24.587,"","0","Gas",0.95,4.22,0.0001785,"Noble gas",1868
3,"Li","Lithium",7.0,"CC80FF","[He]2s1",0.98,182,5.392,0.618,"+1","Solid",453.65,1615,0.534,"Alkali metal",1817
4,"Be","Beryllium",9.012183,"C2FF00","[He]2s2",1.57,153,9.323,"","+2","Solid",1560,2744,1.85,"Alkaline earth metal",1798
5,"B","Boron",10.81,"FFB5B5","[He]2s2 2p1",2.04,192,8.298,0.277,"+3","Solid",2348,4273,2.37,"Metalloid",1808
6,"C","Carbon",12.011,"909090","[He]2s2 2p2",2.55,170,11.260,1.263,"+4, +2, -4","Solid",3823,4098,2.2670,"Nonmetal","Ancient"
7,"N","Nitrogen",14.007,"3050F8","[He] 2s2 2p3",3.04,155,14.534,"","+5, +4, +3,
import numpy
import os
def calculate_distance(coords1, coords2):
x_distance = coords1[0] - coords2[0]
y_distance = coords1[1] - coords2[1]
z_distance = coords1[2] - coords2[2]
distance = numpy.sqrt(x_distance**2 + y_distance**2 + z_distance**2)
return distance
r = abs(5)
def abs(values):
"""Extend abs function to work on lists"""
import builtins
if type(values) == list:
for i in range(len(values)):
values[i] = builtins.abs(values[i])
name: pySCF-env
channels:
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- _openmp_mutex=4.5=1_gnu
- ca-certificates=2021.7.5=h06a4308_1
- certifi=2021.5.30=py38h06a4308_0
- ld_impl_linux-64=2.35.1=h7274673_9
- libffi=3.3=he6710b0_2
@janash
janash / thermo.py
Last active September 2, 2021 15:49
"""
deltaG and deltaH of formation for various substances.
Obtained from
https://www.engineeringtoolbox.com/standard-state-enthalpy-formation-definition-value-Gibbs-free-energy-entropy-molar-heat-capacity-d_1978.html
"""
deltaG = [
2.4600e02,
0.0000e00,
mkdir hello_world
cd hello_world
echo "HELLO WORLD" > hello.txt
rm hello.txt
cd ..
rm -r hello_world
git clone https://github.com/msse-2021-bootcamp/lessons.git
cd lessons
git checkout -b my-new-branch
echo "This line will be at the end of the readme" >> README.md