I have a table that is 27 x 27, each entry corresponds to an element from the periodic table. I use the replacement rules in element list to allow me to convert a list of elements into a list of coordinates, so that I can access values from the table. Here test is a list of elements whose values I want to access. The function getBigSeg returns {0,0} if the core == shell, and otherwise returns the value from the table.
bigSegTable = Table[i + j, {i, 27}, {j, 27}];
getBigSeg[core_, shell_] :=
If[core == shell, {0, 0}, {bigSegTable[[core, shell ]] ,
bigSegTable[[core, shell]]}]
elementList = {"Sc" -> 1, "Ti" -> 2, "V" -> 3, "Cr" -> 4, "Mn" -> 5,
"Fe" -> 6, "Co" -> 7, "Ni" -> 8, "Cu" -> 9, "Zn" -> 10, "Y" -> 11,
"Zr" -> 12, "Nb" -> 13, "Mo" -> 14, "Tc" -> 15, "Ru" -> 16,
"Rh" -> 17, "Pd" -> 18, "Ag" -> 19, "Hf" -> 20, "Ta" -> 21,
"W" -> 22, "Re" -> 23, "Os" -> 24, "Ir" -> 25, "Pt" -> 26,
"Au" -> 27};
test = {{"Ti", "Ag"}, {"Zr", "Ag"}, {"Nb", "Ag"}, {"Tc", "Ag"}, {"Ru",
"Ag"}, {"Ag", "Ag"}, {"Hf", "Ag"}, {"Ta", "Ag"}, {"Re",
"Ag"}, {"Os", "Ag"}, {"Ir", "Ag"}};
I want to know why if I do: getBigSeg[#1, #2] & @@@ test /. elementList
I get an error. But I do not get an error if I do
getBigSeg[#1, #2] & @@@ {{2, 19}, {12, 19}, {13, 19}, {15, 19}, {16,
19}, {19, 19}, {20, 19}, {21, 19}, {23, 19}, {24, 19}, {25, 19}}
This is strange to me because
test /. elementList
gives
{{2, 19}, {12, 19}, {13, 19}, {15, 19}, {16,
19}, {19, 19}, {20, 19}, {21, 19}, {23, 19}, {24, 19}, {25, 19}}
So I do not understand why I am getting an error, and what is different between the two expressions.