Skip to content

Commit

Permalink
Using Cartesian routine for link with ExternalFromReal (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
epolack authored Apr 11, 2022
1 parent e305612 commit 952894f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/polarizability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tol = 1e-8

## dipole moment of a given density (assuming the current geometry)
function dipole(basis, ρ)
rr = [a * (r[1] - 1/2) for r in r_vectors(basis)]
rr = [(r[1] - a/2) for r in r_vectors_cart(basis)]
sum(rr .* ρ) * basis.dvol
end;

Expand Down Expand Up @@ -92,7 +92,7 @@ end

## δVext is the potential from a uniform field interacting with the dielectric dipole
## of the density.
δVext = [-a * (r[1] - 1/2) for r in r_vectors(basis)]
δVext = [-(r[1] - a/2) for r in r_vectors_cart(basis)]
δVext = cat(δVext; dims=4)

## Apply χ0 once to get non-interacting dipole
Expand Down

0 comments on commit 952894f

Please sign in to comment.