Phonon.SelfConsistentField depends on the last step results (optimized cells), so it may acquire a variable that takes either a new_structure or output. And Dfpt is even more complicated because it needs input from previous steps. But how to distribute the function on each slice of its arguments? One way is
function f(g, args...; kwargs...)
map(zip(args...)) do arg
g(arg...; kwargs...)
end
end
Phonon.SelfConsistentField
depends on the last step results (optimized cells), so it may acquire a variable that takes either anew_structure
oroutput
. AndDfpt
is even more complicated because it needs input from previous steps. But how to distribute the function on each slice of its arguments? One way isThis is exactly like
IterTools.imap
.However,
Base.map
can do similar things. But it cannot takekwargs
, so isIterTools.imap
. The most flexible one is the one I wrote above.