Apply the first element of `pulse_effects` to the `walker` at the given `pulse_time`.
Apply the first element of `pulse_effects` to the `walker` at the given `pulse_time`.
The following steps will be taken if the first `pulse_effect` is not `:ignore`
The following steps will be taken if the first `pulse_effect` is not `:ignore`
- if `walker.transverse` is true before the pulse, increase the `walker.bmat` by the outer product of `walker.qvec` with itself multiplied by the time since the last gradient
- if `walker.is_transverse` is true before the pulse, increase the `walker.bmat` by the outer product of `walker.qvec` with itself multiplied by the time since the last gradient
- update `walker.duration_states` with time since last pulse.
- update `walker.duration_states` with time since last pulse.
- update `walker.last_pulse_time`
- update `walker.last_pulse_time`
- update `walker.is_transverse`, and `walker.is_positive` based on the first value in `pulse_effects`.
- update `walker.is_transverse`, and `walker.is_positive` based on the first value in `pulse_effects`.
...
@@ -334,10 +351,10 @@ function update_walker_pulse!(walker::PathwayWalker, pulse_effects::AbstractVect
...
@@ -334,10 +351,10 @@ function update_walker_pulse!(walker::PathwayWalker, pulse_effects::AbstractVect
error("Invalid pulse instruction ($instruction); This error should have been caught earlier.")
error("Invalid pulse instruction ($instruction); This error should have been caught earlier.")
...
@@ -357,7 +374,7 @@ end
...
@@ -357,7 +374,7 @@ end
Update the walker's `qvec` and `bmat` based on the given `gradient_block`.
Update the walker's `qvec` and `bmat` based on the given `gradient_block`.
The following steps will be taken:
The following steps will be taken:
- Do nothing if `walker.transverse` is false
- Do nothing if `walker.is_transverse` is false
- increase the appropriate `walker.bmat` by the outer product of `walker.qvec` with itself multiplied by the time since the last gradient
- increase the appropriate `walker.bmat` by the outer product of `walker.qvec` with itself multiplied by the time since the last gradient
- update the appropriate `walker.qvec` and `walker.bmat` based on the gradient waveform. This will require appropriate `qvec`/`bmat` functions to be defined for the gradient building block.
- update the appropriate `walker.qvec` and `walker.bmat` based on the gradient waveform. This will require appropriate `qvec`/`bmat` functions to be defined for the gradient building block.
- update `walker.last_gradient_time` to the time at the end of the gradient.
- update `walker.last_gradient_time` to the time at the end of the gradient.
...
@@ -365,7 +382,7 @@ The following steps will be taken:
...
@@ -365,7 +382,7 @@ The following steps will be taken:
This requires [`bmat`](@ref) and [`qvec`](@ref) to be implemented for the [`GradientBlock`](@ref).
This requires [`bmat`](@ref) and [`qvec`](@ref) to be implemented for the [`GradientBlock`](@ref).
"""
"""
function update_walker_gradient!(gradient::GradientBlock,walker::PathwayWalker,gradient_start_time::VariableType)
function update_walker_gradient!(gradient::GradientBlock,walker::PathwayWalker,gradient_start_time::VariableType)