Skip to content

Commit

Permalink
Merge branch 'do_not_add_perturbations_by_default' into 'master'
Browse files Browse the repository at this point in the history
Changed the INQ interface so when a new perturbation is defined, it overwrites the previous one

See merge request npneq/inq!1161
  • Loading branch information
xavierandrade committed Nov 17, 2024
2 parents 2e9415f + 11ae9aa commit becc2ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/interface/perturbations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ These are the uses for the command:
Python: `perturbations.status()`
Without any arguments (or with the status() function in Python),
`perturbations` prints a list of the perturbations that are
currently defined.
`perturbations` prints a the perturbations that are currently
defined.
Shell example: `inq perturbations`.
Python example: `pinq.perturbations.status()`
Expand All @@ -61,7 +61,7 @@ These are the uses for the command:
- Shell: `perturbations kick <px> <py> <pz>`
Python: `perturbations.kick([px, py, pz])`
Adds a kick perturbation. This corresponds of a uniform
Specifies a kick perturbation. This corresponds of a uniform
time-dependent electric field. The time profile is a delta function
at time 0. The direction and intensity of the field is given by the
values _px_, _py_ and _pz_ (these values are in cartesian units and
Expand Down Expand Up @@ -124,13 +124,15 @@ These are the uses for the command:

static void kick(vector3<double, cartesian> const & polarization) {
auto perturbations = perturbations::blend::load(".inq/default_perturbations");
perturbations.clear();
auto cell = systems::ions::load(".inq/default_ions").cell();
perturbations.add(perturbations::kick(cell, polarization));
perturbations.save(input::environment::global().comm(), ".inq/default_perturbations");
}

static void laser(vector3<double, cartesian> const & polarization, quantity<magnitude::energy> freq) {
auto perturbations = perturbations::blend::load(".inq/default_perturbations");
perturbations.clear();
auto cell = systems::ions::load(".inq/default_ions").cell();
if(cell.periodicity() == 0){
perturbations.add(perturbations::laser(polarization, freq, perturbations::gauge::length));
Expand Down

0 comments on commit becc2ed

Please sign in to comment.