Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ddahlbom committed Oct 16, 2024
1 parent 89f4bb9 commit d8a731a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/EntangledUnits/TypesAndAliasing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,16 @@ end
function coherent_state_from_dipoles(esys::EntangledSystem, dipoles, unit)
(; sys_origin, contraction_info) = esys

# Find the sites/atoms (or original system) that lie in the specified unit
# Find the atom indices (of original system) that lie in the specified unit
# (of contracted system).
original_sites = [id.site for id in contraction_info.inverse[unit]]
atoms = [id.site for id in contraction_info.inverse[unit]]

# Make sure that the user gave the correct number of dipoles to fully
# specify the coherent state of the entangled unit.
@assert length(dipoles) == length(original_sites) "Invalid number of dipoles for specified unit."
# Test that the number of specified dipoles is equal to the number of atoms
# inside the entangled unit.
@assert length(dipoles) == length(atoms) "Invalid number of dipoles for specified unit."

# Retrieve the dimensions of the local Hilbert spaces of those sites.
# Retrieve the dimensions of the local Hilbert spaces corresponding to those
# atoms.
Ns = Ns_in_units(sys_origin, contraction_info)[unit]

# Generate a list of coherent states corresponding to given dipoles _in each
Expand Down

0 comments on commit d8a731a

Please sign in to comment.