Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ACEsuit committed May 28, 2024
1 parent ed347b9 commit 997c761
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ g = Zygote.gradient(f, [x1, x2])[1]

g[1].𝐫 β‰ˆ 2 * x1.𝐫
# true

# Some property symbols are standardized, e.g. 𝐫 always means `position`
x1.𝐫 == position(x1) # true

# a 4-momentum might look like this
p = PState(𝐩 = randn(SVector{3, Float64}), 𝐸 = rand())
p.𝐩 == DP.momentum(p)
p.𝐸 == DP.energy(p)
```

### Prototype AtomsBase system implementations
Expand Down
9 changes: 9 additions & 0 deletions test/_readme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ g = Zygote.gradient(f, [x1, x2])[1]
g[1].𝐫 β‰ˆ 2 * x1.𝐫
# true

# Some property symbols are standardized, e.g. 𝐫 always means `position`
x1.𝐫 == position(x1) # true

# a 4-momentum might look like this
p = PState(𝐩 = randn(SVector{3, Float64}), 𝐸 = rand())
p.𝐩 == DP.momentum(p)
p.𝐸 == DP.energy(p)

## ---------------------------------------------------
# Prototype AtomsBase system implementations
# Both AosSystem and SoaSystem are fully flexible regarding the
Expand Down Expand Up @@ -82,3 +90,4 @@ silly_test_2(sys) = sum( position(x) for x in sys )
@btime silly_test_2($fsys) # 48.118 ns (0 allocations: 0 bytes)
@btime silly_test_2($aos) # 47.950 ns (0 allocations: 0 bytes)
@btime silly_test_2($soa) # 48.794 ns (0 allocations: 0 bytes)

0 comments on commit 997c761

Please sign in to comment.