Skip to content

Commit

Permalink
More concise
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Dec 10, 2024
1 parent f19acea commit 7858afd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ext/PlottingExt/ViewCrystal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ function label_atoms(cryst; ismagnetic)
refatoms = [b.i for b in Sunny.reference_bonds(cryst, 0.0)]
i_ref = Sunny.findfirstval(i_ref -> Sunny.is_related_by_symmetry(cryst, i, i_ref), refatoms)
R_site = Sunny.rotation_between_sites(cryst, i, i_ref)
push!(ret, Sunny.allowed_g_tensor_string(cryst, i_ref; R_site, digits=8, atol=1e-12))
push!(ret, "See print_site($i; i_ref=$i_ref)")
push!(ret, Sunny.allowed_g_tensor_string(cryst, i_ref; R_site, prefix="Aniso: ", digits=8, atol=1e-12))
end
join(ret, "\n")
end
Expand Down
4 changes: 2 additions & 2 deletions src/Symmetry/Printing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,13 @@ function rotation_between_sites(cryst, i, i_ref)
end
end

function allowed_g_tensor_string(cryst, i_ref; R_global=Mat3(I), R_site, digits, atol)
function allowed_g_tensor_string(cryst, i_ref; R_global=Mat3(I), R_site, prefix="Allowed g-tensor: ", digits, atol)
basis = basis_for_symmetry_allowed_couplings(cryst, Bond(i_ref, i_ref, [0, 0, 0]); R_global)
basis = map(basis) do b
R_site * b * R_site' # == transform_coupling_by_symmetry(b, R_site, true)
end
basis_strs = coupling_basis_strings(zip('A':'Z', basis); digits, atol)
return formatted_matrix(basis_strs; prefix="Allowed g-tensor: ")
return formatted_matrix(basis_strs; prefix)
end

function allowed_anisotropy_string(cryst::Crystal, i_ref::Int; R_global::Mat3, R_site::Mat3, digits, atol, ks)
Expand Down

0 comments on commit 7858afd

Please sign in to comment.