Skip to content

Commit

Permalink
docs: fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgardner1421 committed Nov 3, 2021
1 parent 9a7e5d5 commit 764f71f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/src/dynamicssimulations/dynamicsmethods/nrpmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ like to average the results so we use the `MeanReduction`.

```@example nrpmd
output = Ensembles.OutputDiabaticPopulation(sim)
reduction = Ensembles.MeanReduction()
reduction = Ensembles.MeanReduction([zeros(2) for _ in 1:0.1:30])
nothing # hide
```

Expand Down
3 changes: 2 additions & 1 deletion docs/src/dynamicssimulations/dynamicsmethods/rpsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ and it will be averaged over all trajectories by the `MeanReduction`.
```@example rpsh
solution = Ensembles.run_ensemble(sim, (0.0, 3000.0), distribution;
saveat=50, trajectories=5e2, dt=1,
output=Ensembles.OutputDiabaticPopulation(sim), reduction=Ensembles.MeanReduction())
output=Ensembles.OutputDiabaticPopulation(sim),
reduction=Ensembles.MeanReduction([zeros(2) for _=0:3000]))
```

!!! note
Expand Down
2 changes: 1 addition & 1 deletion docs/src/ensemble_simulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Here we choose to output the populations of each diabatic state and reduce by av
the results over all trajectories.
```@example ensemble
output = Ensembles.OutputDiabaticPopulation(sim)
reduction = Ensembles.MeanReduction()
reduction = Ensembles.MeanReduction([zeros(2) for _ in 0:10:3000])
nothing # hide
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/spinboson.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ analytic form and we can use the distributions included in the package.
```@example spinboson
position = PositionHarmonicWigner.(model.ωⱼ, β, 1)
velocity = VelocityHarmonicWigner.(model.ωⱼ, β, 1)
distribution = DynamicalDistribution(velocity, position, (1, 100))) * SingleState(1)
distribution = DynamicalDistribution(velocity, position, (1, 100)) * SingleState(1)
nothing # hide
```

Expand Down
5 changes: 3 additions & 2 deletions docs/src/examples/threestatemorse.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ The [`OutputDiabaticPopulation`](@ref Ensembles.OutputDiabaticPopulation) will e
the diabatic population estimator at each timestep.

```@example threestatemorse
reduction = Ensembles.MeanReduction([zeros(3) for _=1:10:3000])
sim = Simulation{FSSH}(atoms, model)
fssh_result = Ensembles.run_ensemble(sim, (0.0, 3000.0), distribution;
saveat=10, trajectories=1e3,
output=Ensembles.OutputDiabaticPopulation(sim), reduction=Ensembles.MeanReduction(), dt=1)
output=Ensembles.OutputDiabaticPopulation(sim), reduction=reduction, dt=1)
sim = Simulation{Ehrenfest}(atoms, model)
ehrenfest_result = Ensembles.run_ensemble(sim, (0.0, 3000.0), distribution;
saveat=10, trajectories=1e3,
output=Ensembles.OutputDiabaticPopulation(sim), reduction=Ensembles.MeanReduction(), dt=1)
output=Ensembles.OutputDiabaticPopulation(sim), reduction=reduction, dt=1)
fig = Figure()
ax = Axis(fig[1,1], xlabel="Time /a.u.", ylabel="Population")
Expand Down
8 changes: 7 additions & 1 deletion docs/src/examples/tully_scattering.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ We can use our [`Ensembles`](@ref) setup to run a set of trajectories for every
momentum value.
Firstly, we can prepare the parts that will be the same for every ensemble:
```@example tullymodeltwo
using ComponentArrays: ComponentVector
output = Ensembles.OutputStateResolvedScattering1D(sim, :adiabatic)
reduction = Ensembles.MeanReduction()
template = ComponentVector(
reflection=zeros(2),
transmission=zeros(2)
)
reduction = Ensembles.MeanReduction(templates)
```
Here we are using the
[`OutputStateResolvedScattering1D`](@ref Ensembles.OutputStateResolvedScattering1D)
Expand Down

0 comments on commit 764f71f

Please sign in to comment.