Skip to content

Commit b08e4f9

Browse files
committed
1 parent 8e71190 commit b08e4f9

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

src/AbstractWavefunctionMC.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ function Carlo.init!(mc::AbstractWavefunctionMC{N}, ctx::MCContext, params::Abst
3535
N_active, dynamic_pos = dynamic_positions(mc)
3636

3737
mc_state[dynamic_pos] = [coordinate_projector(mc)(rand(ctx.rng, distribution(mc))) for _ in 1:N_active]
38-
@show mc_state.position
3938

4039
mc_state.logdensity = logdensity(wavefunction(mc), position(mc_state).buffer)
4140
mc_state.num_accepts = 0

src/WavefunctionMC.jl

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,14 @@ function WavefunctionMC(params::AbstractDict)
5454
distribution = get(params, :distribution, S <: Complex ? ComplexNormal(0, sigma_dist) : Normal(0, sigma_dist))
5555
dynamic_pos = get(params, :dynamic_positions, (N, 1:N))
5656

57-
position = get(params, :position, missing)
58-
if ismissing(position) || isnothing(position)
59-
position = [i in dynamic_pos ? 100 * rand(distribution) : 0 * rand(distribution) for i in 1:N]
57+
fixed_positions = get(params, :fixed_positions, nothing)
58+
position = map(1:N) do i
59+
if !isnothing(fixed_positions) && haskey(fixed_positions, i)
60+
return coordinate_proj(fixed_positions[i])
61+
else
62+
return coordinate_proj(i in dynamic_pos ? 100 * rand(distribution) : 0 * rand(distribution))
63+
end
6064
end
61-
if any(ismissing, position) || any(isnothing, position)
62-
inds = findall(x -> ismissing(x) || isnothing(x), position)
63-
position[inds] = [i in dynamic_pos ? 100 * rand(distribution) : 0 * rand(distribution) for i in inds]
64-
end
65-
# position = FixedSizeArray(coordinate_proj.(position))
66-
position = coordinate_proj.(position)
67-
@show typeof(position)
68-
@show position
6965

7066
observables = get(params, :observables, NoObservables())
7167

0 commit comments

Comments
 (0)