ichesser / GB_octonion_code

Tutorial code for performing a variety of grain boundary computations including conversions between grain boundary representations, grain boundary distance calculations and grain boundary interpolation.
7 stars 1 forks source link

Lab Frame to Octonions, Active/Passive Convention Inconsistency #4

Closed sgbaird closed 3 years ago

sgbaird commented 3 years ago

Hi @ichesser @tobyfrancis @marcdegraef, (sorry for the duplicate, I deleted the comment on #2)

I've been stuck on this for many months now and will need to delay graduation until I can get this figured out 😅 Any help would be much appreciated. I'd be happy to do a Zoom call if that would be easier as well.

I've since moved on from using GBfive2oct() to using GBmat2oct() per Ian's suggestion. The data we're trying to use is in (eA, eB, mA) format (Euler angles & BP normal pointing from A-->B all in lab frame) as experimental Rohrer data typically is formatted, and I'm still running into an issue with GBs being physically changed during either the conversion or the symmetrization process (one or the other based on convention, see "Issues" section below).

Observations

  1. the quaternion multiplication seems to be given in the active sense (eq.3 of [1]) which corresponds to P==1 in eq.23 of [2]
  2. the misorientation quaternion seems to be given in the passive sense (eq.4 of [1]). (Aside: Because [2] doesn't explicitly cover misorientation quaternions, I'm going off of discussion with Dr. Oliver Johnson for which definition is active vs. passive)
  3. the quaternions seem to be given in the passive sense (e.g. eq.1 of [1], also several definitions in supplementary of [1]), where P==-1 in eq.22 of [2]
  4. zeta_min() derivation (eq. 28, 29 of [1]) seems to depend on active-quaternion multiplication via eq. 17, 18 of [1] but uses passively defined quaternions

Questions

  1. are my observations above about use of passive vs. active conventions in [1] correct?
  2. if so, why is the quaternion multiplication given in the active sense, but the misorientation quaternion given in the passive sense?
  3. are the symmetry operators in PGsymops.mat inherently active vs. passive? (Update: noticed in [1] "the symmetry elements of this group can be expressed as (passive) rotation quaternions ...")
  4. If not, does their usage in the paper/code explicitly assume an active vs. passive convention? (e.g. eq.36 of [1])
  5. Is zeta_min() derivation explicitly dependent on active vs. passive convention?

Issues

  1. If I use active-quaternion multiplication and the passive misorientation quaternion definition, the GB physically changes (i.e. disorientation is different) after converting to an octonion, but stays the same (i.e. disorientation is constant) when applying symmetry operators (including zeta_min()) within GBdist().
  2. If I use active-quaternion multiplication and the active misorientation quaternion definition (or passive-passive), the GB disorientation stays the same as it's converted to an octonion, but the GB physically changes as symmetrization is implemented internally within GBdist().

Remarks

Thank you for the help so far and I look forward to hearing back,

Sterling

P.S. attached is a cosmetically modified version of disorientation() from [3], renamed to disorientation.txt, since GitHub doesn't accept .m file uploads.

References

[1] Francis, T.; Chesser, I.; Singh, S.; Holm, E. A.; De Graef, M. A Geodesic Octonion Metric for Grain Boundaries. Acta Materialia 2019, 166, 135–147. https://doi.org/10.1016/j.actamat.2018.12.034. [2] Rowenhorst, D.; Rollett, A. D.; Rohrer, G. S.; Groeber, M.; Jackson, M.; Konijnenberg, P. J.; De Graef, M. Consistent Representations of and Conversions between 3D Rotations. Modelling Simul. Mater. Sci. Eng. 2015, 23 (8), 083501. https://doi.org/10.1088/0965-0393/23/8/083501. [3] Seita, M.; Volpi, M.; Patala, S.; McCue, I.; Schuh, C. A.; Diamanti, M. V.; Erlebacher, J.; Demkowicz, M. J. A High-Throughput Technique for Determining Grain Boundary Character Non-Destructively in Microstructures with through-Thickness Grains. Npj Computational Materials 2016, 2, 16016.

ichesser commented 3 years ago

Hey Sterling,

Can you attach or email .m scripts that show examples of Issues 1 and 2? When you say that the GBs are physically changed in Issue 2, do you mean that the 5 DOF are changed, or is it simply the same GB but differing by cubic symmetry operators? I will take a look at these and then try to respond to your questions.

As far as alternative solutions, what EMsoft functionality would you need to help with these issues? (@marcdegraef)

-- Ian Chesser / ichesser@andrew.cmu.edu / 713-516-2491

On Nov 24, 2020, at 6:08 AM, sgbaird notifications@github.com wrote:

Hi @ichesser https://github.com/ichesser @tobyfrancis https://github.com/tobyfrancis @marcdegraef https://github.com/marcdegraef, (sorry for the duplicate, I deleted the comment on #2 https://github.com/ichesser/GB_octonion_code/issues/2)

I've been stuck on this for many months now and will need to delay graduation until I can get this figured out 😅 Any help would be much appreciated. I'd be happy to do a Zoom call if that would be easier as well.

I've since moved on from using GBfive2oct() to using GBmat2oct() per Ian's suggestion. The data we're trying to use is in (eA, eB, mA) format (Euler angles & BP normal pointing from A-->B all in lab frame) as experimental Rohrer data typically is formatted, and I'm still running into an issue with GBs being physically changed during either the conversion or the symmetrization process (one or the other based on convention, see "Issues" section below).

Observations

the quaternion multiplication seems to be given in the active sense (eq.3 of [1]) which corresponds to P==1 in eq.23 of [2] the misorientation quaternion seems to be given in the passive sense (eq.4 of [1]). (Aside: Because [2] doesn't explicitly cover misorientation quaternions, I'm going off of discussion with Dr. Oliver Johnson for which definition is active vs. passive) the quaternions seem to be given in the passive sense (e.g. eq.1 of [1], also several definitions in supplementary of [1]), where P==-1 in eq.22 of [2] zeta_min() derivation (eq. 28, 29 of [1]) seems to depend on active-quaternion multiplication via eq. 17, 18 of [1] but uses passively defined quaternions Questions

are my observations above about use of passive vs. active conventions in [1] correct? if so, why is the quaternion multiplication given in the active sense, but the misorientation quaternion given in the passive sense? are the symmetry operators in PGsymops.mat inherently active vs. passive? If not, does their usage in the paper/code explicitly assume an active vs. passive convention? (e.g. eq.36 of [1]) Is zeta_min() derivation explicitly dependent on active vs. passive convention? Issues

If I use active-quaternion multiplication and the passive misorientation quaternion definition, the GB physically changes (i.e. disorientation is different) after converting to an octonion, but stays the same (i.e. disorientation is constant) when applying symmetry operators (including zeta_min()) within GBdist(). If I use active-quaternion multiplication and the active misorientation quaternion definition (or passive-passive), the GB disorientation stays the same as it's converted to an octonion, but the GB physically changes as symmetrization is implemented internally within GBdist(). Remarks

There seems to be an inconsistency of active vs. passive conventions indicated by a physical change in the GB which occurs during conversion using original definitions in [1] or symmetrization if using active-active (or passive-passive) definitions for quaternion multiplication/misorientation. I think that zeta_min() may need to be rederived w.r.t. passive quaternion multiplication (or active misorientation) in order to produce symmetrically equivalent GBs at all stages of the process (conversion and symmetrization). What do you think? Thank you for the help so far and I look forward to hearing back,

Sterling

P.S. attached is a cosmetically modified version of disorientation() from [3], renamed to disorientation.txt https://github.com/ichesser/GB_octonion_code/files/5589400/disorientation.txt, since GitHub doesn't accept .m file uploads.

References

[1] Francis, T.; Chesser, I.; Singh, S.; Holm, E. A.; De Graef, M. A Geodesic Octonion Metric for Grain Boundaries. Acta Materialia 2019, 166, 135–147. https://doi.org/10.1016/j.actamat.2018.12.034 https://doi.org/10.1016/j.actamat.2018.12.034. [2] Rowenhorst, D.; Rollett, A. D.; Rohrer, G. S.; Groeber, M.; Jackson, M.; Konijnenberg, P. J.; De Graef, M. Consistent Representations of and Conversions between 3D Rotations. Modelling Simul. Mater. Sci. Eng. 2015, 23 (8), 083501. https://doi.org/10.1088/0965-0393/23/8/083501 https://doi.org/10.1088/0965-0393/23/8/083501. [3] Seita, M.; Volpi, M.; Patala, S.; McCue, I.; Schuh, C. A.; Diamanti, M. V.; Erlebacher, J.; Demkowicz, M. J. A High-Throughput Technique for Determining Grain Boundary Character Non-Destructively in Microstructures with through-Thickness Grains. Npj Computational Materials 2016, 2, 16016.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ichesser/GB_octonion_code/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVFI2EQW6DMBL6XJB7MCNDSROH2PANCNFSM4UAXOHJQ.

sgbaird commented 3 years ago

Hi Ian,

Thanks for the quick response! Here is eumA2five_test2.zip for the two issues. It's set up to demonstrate the first issue by default (i.e. active-passive qmult-qm). To switch to the second issue (active-active), toggle the commented statements in qlab2qm.m, which by default looks like:

qm = qmult(qBlab,qinv(qAlab),epsijk); %issue1: produces consistent results internally within GBdist(), but not during conversion
%qm = qmult(qinv(qAlab),qBlab,epsijk); %issue2: produces consistent results in 5DOF-->octonion conversion, but not within GBdist()

I recommend opening up a separate MATLAB window to make it easy to keep a separate path for running eumA2five_test2.m. Run addpath(genpath('./')) or similar with the unzipped folder as the working directory before running eumA2five_test2.m. I tried to keep the base functionality of the somewhat modified functions from the original repository, but feel free to swap them out with the originals.

For each of the two issues, by physically changed, I mean a single GB will map to a different disorientation (i.e. the 5DOF seems to be fundamentally changed, not just a symmetry effect from what I can tell). In the first issue, this happens during conversion, and in the second issue this happens internally within GBdist(). In terms of EMsoft functionality (I'm not sure if this was only addressed to Dr. De Graef), a routine for converting from (eA,eB,mA) sets to octonions might be an alternative solution at least for testing/validation, though the rest of my codebase is primarily in MATLAB.

See the following output from eumA2five_test2():

Issue 1 Output:

                                       qm                                     nA               
                    ________________________________________    _______________________________

    start           0.90446    0.28232     0.2351    0.21672    0.80812     0.27064     0.52316
    vecpair2rmat    0.88537    0.31116     0.2733     0.2112    0.80812     0.27064     0.52316
    GBmat2oct       0.88537    0.31116     0.2733     0.2112    0.80812     0.27064     0.52316
    symmetrized     0.88537    0.31116     0.2733     0.2112    0.12151    0.017721    -0.99243

Issue 2 Output:

                                        qm                                      nA              
                    ___________________________________________    _____________________________

    start           0.90053     0.28557     0.27683     0.17568    0.80812    0.27064    0.52316
    vecpair2rmat    0.90053     0.28557     0.27683     0.17568    0.80812    0.27064    0.52316
    GBmat2oct       0.90053     0.28557     0.27683     0.17568    0.80812    0.27064    0.52316
    symmetrized     0.94837     0.29963    0.079679    0.066776    0.80812    0.27064    0.52316

There are some crude plotting animations factored into the code that I made to try to help with troubleshooting. Feel free to comment these out or speed up the transitions if they get annoying. For example here is Figure 2 from Issue 2: image

Thanks again and let me know if you have questions,

Sterling

ichesser commented 3 years ago

Hi Sterling,

I have had a chance to look at your code and I see what you are describing. Thank you for the detailed documentation of these issues. Regarding Issue 1, I am not 100% sure that (q_m, n_A) in the symmetrized case (with a different n_A) is different from the other cases if symmetries in the boundary plane fundamental zone are considered. As described in http://dx.doi.org/10.1080/14786435.2012.722700 (Eq 4), depending on misorientation and point group symmetry, there are many symmetrically equivalent choices of plane inclination. It would be helpful to check whether nA_symmetrized and the other nA that you expect are separated by a cubic symmetry operator. You could enumerate the entire list of symmetrically equivalent inclinations in the boundary plane fundamental zone following the algorithm in the above paper, by applying S_i^-1 M S_j where S_j are symmetry operators and M is misorientation, finding cases where S_i^-1 M S_j = M, and then computing all S_i^-1*nA for which this condition is satisfied. If this check still shows that the 5 GB DOF are different, then we can discuss the active/passive conventions in more detail.

sgbaird commented 3 years ago

Hi Ian,

Thank you for looking into this. You bring up a good point about BP symmetries. This is something I've considered and because the quaternion misorientation is a randomly generated one, the only symmetry I'd typically expect is a single inversion symmetry. This is confirmed by a simple check:

Spairs = get_sympairs(pgnum);
Spairs = [Spairs; -Spairs];
SA = Spairs(:,1:4);
SB = Spairs(:,5:8);
nsym = size(Spairs,1);
qmsymrep = repmat(qmsym,nsym,1);
qcheck = qmult(qinv(SA),qmult(qmsymrep,SB));
find(ismembertol(qcheck,qmsym,1e-1,'ByRows',true))

where get_sympairs() uses allcomb() and pgsymops.mat to produce all combinations of the symmetry operators.

The only indices that map to the same quaternion within a generous tolerance of 0.1 are 1 and 577 which correspond to [1 0 0 0] and [-1 0 0 0], respectively.

Sterling

ichesser commented 3 years ago

Hey Sterling, were you able to make any headway on this issue? I will have a bit more time soon and could return to this if needed... Best, Ian

sgbaird commented 3 years ago

Hi Ian,

Thanks for checking in! I think I've got it figured out. It took a while, and it's hard to describe succinctly (partly because I tried so many things), but I ended up incorporating a parameter that changes the convention assumption and found a sequence that produces expected results with the tools I had available (probing GBE using GB5DOF at various points in the conversion, testing misorientation and BP normals, converting back and forth, visualization of rotations, etc.).

Sterling

ichesser commented 3 years ago

That is good to hear! If you happen to publish code related to that part of the project, I will add a link on this page.

On Jan 21, 2021, at 9:23 PM, sgbaird notifications@github.com wrote:

 Hi Ian,

Thanks for checking in! I think I've got it figured out. It took a while, and it's hard to describe succinctly (partly because I tried so many things), but I ended up incorporating a parameter that changes the convention assumption and found a sequence that produces expected results with the tools I had available (probing GBE using GB5DOF at various points in the conversion, testing misorientation and BP normals, converting back and forth, visualization of rotations, etc.).

Sterling

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

sgbaird commented 3 years ago

Hey Ian! Just made the repo public: https://github.com/sgbaird-5DOF/interp, see also the paper on ArXiv. In particular, the relevant functions for this thread are oct2five.m and five2oct.m. Cheers!

sgbaird commented 2 years ago

@ichesser while a little late, I figured I should share that the paper was accepted to computational materials science!

Baird, S. G.; Homer, E. R.; Fullwood, D. T.; Johnson, O. K. Five Degree-of-Freedom Property Interpolation of Arbitrary Grain Boundaries via Voronoi Fundamental Zone Framework. Computational Materials Science 2021, 200, 110756. https://doi.org/10.1016/j.commatsci.2021.110756.

We also have a follow-up we're getting ready soon, and here's the preprint for now.

Baird, S. G.; Homer, E. R.; Fullwood, D. T.; Johnson, O. K. Towards a Quantitative Cartography of the Grain Boundary Energy Landscape: Paths and Correlations; preprint; Chemistry, 2021. https://doi.org/10.26434/chemrxiv-2021-ds0ml.