CASMcode icon indicating copy to clipboard operation
CASMcode copied to clipboard

Formation energy of endmembers should be zero by CLEX

Open sjtuzhanglei opened this issue 1 year ago • 6 comments

Dear CASM developers,

My current best fit should first make sure the endmember is correct and fixed to zero. Otherwise the clex hull has no thermodynamic meaning.

As far as I know, endmembers are fitted together with the points in the middle compositions. Similarly, ECIs of zeros and first order, which solely determine the formation energy of the endmembers, are also optimized together with 2nd and higher order ones.

In this case, I want to first make sure the clex endmember is correct and stick to zero.

My idea is to fit those zeroth and 1st-order ECIs first and fix them afterwards when fitting 2nd and higher order ECIs.

Can CASM do that, or have you encountered the same issue before?

Thanks, Lei

sjtuzhanglei avatar Nov 23 '23 17:11 sjtuzhanglei

You can manually set the null term to 0, which will fix the clex energy of the unperturbed structure to 0. You could either do it by editing eci.json by hand, or by using this function to add ECIs to basis.json: https://github.com/Van-der-Ven-Group/thermocore/blob/53daacf16e7fe36a62d0d47f7c4f0cc571696f5d/thermocore/io/casm.py#L101

xivh avatar Nov 27 '23 19:11 xivh

Hi xivh,

The null term you mean is the zeroth-order term in cluster expansion ("\Phi_{0}" : "1")? That will shift all data points constantly right?

But the first-order terms, "\Phi_{1}" : "\phi_{0,0}(s_{0})" "\Phi_{2}" : "\phi_{1,0}(s_{0})" "\Phi_{3}" : "\phi_{2,0}(s_{0})" are shifting each endmember individually. Since I have 3 sublattices, each controls 1 sublattice's two endmembers. And since I only have 2-component mixing in sublattice 0, I only need to worry about Phi_{1}, right? How does Phi_{1} correct the values of the two endmembers in sublattice 0 (In my case, the two endmembers forming a tilted convex hull)?

I might need some interpretation of the coded terms and cluster expansion terms.

Thank you!

On Mon, Nov 27, 2023 at 2:30 PM xivh @.***> wrote:

You can manually set the null term to 0, which will fix the clex energy of the unperturbed structure to 0. You could either do it by editing eci.json by hand, or by using this function to add ECIs to basis.json: https://github.com/Van-der-Ven-Group/thermocore/blob/53daacf16e7fe36a62d0d47f7c4f0cc571696f5d/thermocore/io/casm.py#L101

— Reply to this email directly, view it on GitHub https://github.com/prisms-center/CASMcode/issues/340#issuecomment-1828476582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDNA5NRTZPW3HVWMZ3KSATYGTS4BAVCNFSM6AAAAAA7YDERLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYGQ3TMNJYGI . You are receiving this because you authored the thread.Message ID: @.***>

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

sjtuzhanglei avatar Nov 29 '23 15:11 sjtuzhanglei

From your suggestion, I assume the manipulation of the null term is after the casm-learn process?

Since all terms are optimized together during the casm-learn, will the post-mortem manipulation affect not just the endmember but the overall fitting quality?

If the zeroth and first order ECIs solely determine the endmembers, why not we first obtain the values of them using the endmembers and then fit the 2nd and higher order ECIs using the data points in the middle of composition?

On Wed, Nov 29, 2023 at 10:24 AM Lei Zhang @.***> wrote:

Hi xivh,

The null term you mean is the zeroth-order term in cluster expansion ("\Phi_{0}" : "1")? That will shift all data points constantly right?

But the first-order terms, "\Phi_{1}" : "\phi_{0,0}(s_{0})" "\Phi_{2}" : "\phi_{1,0}(s_{0})" "\Phi_{3}" : "\phi_{2,0}(s_{0})" are shifting each endmember individually. Since I have 3 sublattices, each controls 1 sublattice's two endmembers. And since I only have 2-component mixing in sublattice 0, I only need to worry about Phi_{1}, right? How does Phi_{1} correct the values of the two endmembers in sublattice 0 (In my case, the two endmembers forming a tilted convex hull)?

I might need some interpretation of the coded terms and cluster expansion terms.

Thank you!

On Mon, Nov 27, 2023 at 2:30 PM xivh @.***> wrote:

You can manually set the null term to 0, which will fix the clex energy of the unperturbed structure to 0. You could either do it by editing eci.json by hand, or by using this function to add ECIs to basis.json: https://github.com/Van-der-Ven-Group/thermocore/blob/53daacf16e7fe36a62d0d47f7c4f0cc571696f5d/thermocore/io/casm.py#L101

— Reply to this email directly, view it on GitHub https://github.com/prisms-center/CASMcode/issues/340#issuecomment-1828476582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDNA5NRTZPW3HVWMZ3KSATYGTS4BAVCNFSM6AAAAAA7YDERLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYGQ3TMNJYGI . You are receiving this because you authored the thread.Message ID: @.***>

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

sjtuzhanglei avatar Nov 29 '23 17:11 sjtuzhanglei

Since I only have 2-component mixing in the sublattice zero, only Phi_{1} is meaningful, why do Phi_{2} and Phi_{3} have a fitted value as well?

Currently I have:

"\Phi_{0}" : "1", "eci": -0.01763410598459439

"\Phi_{1}" : "\phi_{0,0}(s_{0})", "eci": -0.5680460181890142

"\Phi_{2}" : "\phi_{1,0}(s_{0})" , "eci": -0.48863768604173285

"\Phi_{3}" : "\phi_{2,0}(s_{0})", "eci": -0.4179223578854807

On Wed, Nov 29, 2023 at 12:07 PM Lei Zhang @.***> wrote:

From your suggestion, I assume the manipulation of the null term is after the casm-learn process?

Since all terms are optimized together during the casm-learn, will the post-mortem manipulation affect not just the endmember but the overall fitting quality?

If the zeroth and first order ECIs solely determine the endmembers, why not we first obtain the values of them using the endmembers and then fit the 2nd and higher order ECIs using the data points in the middle of composition?

On Wed, Nov 29, 2023 at 10:24 AM Lei Zhang @.***> wrote:

Hi xivh,

The null term you mean is the zeroth-order term in cluster expansion ("\Phi_{0}" : "1")? That will shift all data points constantly right?

But the first-order terms, "\Phi_{1}" : "\phi_{0,0}(s_{0})" "\Phi_{2}" : "\phi_{1,0}(s_{0})" "\Phi_{3}" : "\phi_{2,0}(s_{0})" are shifting each endmember individually. Since I have 3 sublattices, each controls 1 sublattice's two endmembers. And since I only have 2-component mixing in sublattice 0, I only need to worry about Phi_{1}, right? How does Phi_{1} correct the values of the two endmembers in sublattice 0 (In my case, the two endmembers forming a tilted convex hull)?

I might need some interpretation of the coded terms and cluster expansion terms.

Thank you!

On Mon, Nov 27, 2023 at 2:30 PM xivh @.***> wrote:

You can manually set the null term to 0, which will fix the clex energy of the unperturbed structure to 0. You could either do it by editing eci.json by hand, or by using this function to add ECIs to basis.json: https://github.com/Van-der-Ven-Group/thermocore/blob/53daacf16e7fe36a62d0d47f7c4f0cc571696f5d/thermocore/io/casm.py#L101

— Reply to this email directly, view it on GitHub https://github.com/prisms-center/CASMcode/issues/340#issuecomment-1828476582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDNA5NRTZPW3HVWMZ3KSATYGTS4BAVCNFSM6AAAAAA7YDERLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYGQ3TMNJYGI . You are receiving this because you authored the thread.Message ID: @.***>

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

sjtuzhanglei avatar Nov 29 '23 17:11 sjtuzhanglei

After deriving the equations of cluster expansion, I think all ECIs contribute to the formation energy of the endmembers, not just the null and 1st order ones.

On Wed, Nov 29, 2023 at 12:28 PM Lei Zhang @.***> wrote:

Since I only have 2-component mixing in the sublattice zero, only Phi_{1} is meaningful, why do Phi_{2} and Phi_{3} have a fitted value as well?

Currently I have:

"\Phi_{0}" : "1", "eci": -0.01763410598459439

"\Phi_{1}" : "\phi_{0,0}(s_{0})", "eci": -0.5680460181890142

"\Phi_{2}" : "\phi_{1,0}(s_{0})" , "eci": -0.48863768604173285

"\Phi_{3}" : "\phi_{2,0}(s_{0})", "eci": -0.4179223578854807

On Wed, Nov 29, 2023 at 12:07 PM Lei Zhang @.***> wrote:

From your suggestion, I assume the manipulation of the null term is after the casm-learn process?

Since all terms are optimized together during the casm-learn, will the post-mortem manipulation affect not just the endmember but the overall fitting quality?

If the zeroth and first order ECIs solely determine the endmembers, why not we first obtain the values of them using the endmembers and then fit the 2nd and higher order ECIs using the data points in the middle of composition?

On Wed, Nov 29, 2023 at 10:24 AM Lei Zhang @.***> wrote:

Hi xivh,

The null term you mean is the zeroth-order term in cluster expansion ("\Phi_{0}" : "1")? That will shift all data points constantly right?

But the first-order terms, "\Phi_{1}" : "\phi_{0,0}(s_{0})" "\Phi_{2}" : "\phi_{1,0}(s_{0})" "\Phi_{3}" : "\phi_{2,0}(s_{0})" are shifting each endmember individually. Since I have 3 sublattices, each controls 1 sublattice's two endmembers. And since I only have 2-component mixing in sublattice 0, I only need to worry about Phi_{1}, right? How does Phi_{1} correct the values of the two endmembers in sublattice 0 (In my case, the two endmembers forming a tilted convex hull)?

I might need some interpretation of the coded terms and cluster expansion terms.

Thank you!

On Mon, Nov 27, 2023 at 2:30 PM xivh @.***> wrote:

You can manually set the null term to 0, which will fix the clex energy of the unperturbed structure to 0. You could either do it by editing eci.json by hand, or by using this function to add ECIs to basis.json: https://github.com/Van-der-Ven-Group/thermocore/blob/53daacf16e7fe36a62d0d47f7c4f0cc571696f5d/thermocore/io/casm.py#L101

— Reply to this email directly, view it on GitHub https://github.com/prisms-center/CASMcode/issues/340#issuecomment-1828476582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDNA5NRTZPW3HVWMZ3KSATYGTS4BAVCNFSM6AAAAAA7YDERLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYGQ3TMNJYGI . You are receiving this because you authored the thread.Message ID: @.***>

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

sjtuzhanglei avatar Nov 29 '23 21:11 sjtuzhanglei

  1. Yes, the null term is a constant shift. In a simple binary system, setting the null term to 0 would give a perfect fit for one composition extreme, but the other composition extreme depends on all of the terms, so it would only work for one of your endstates.

  2. I have your prim from earlier, so I generated the point clusters. If you do casm bset --functions, then you can see the basis functions. Here are the first few lines:

** Branch 0 ** 
    ** 0 of 7 Orbits **  Points: 0  Mult: 1  MinLength: 0.00000  MaxLength: 0.00000
        Prototype of 1 Equivalent Clusters in Orbit 0
            Coordinates:
        Prototype basis functions:
            \Phi_{0} = 1

** Branch 1 ** 
    ** 1 of 7 Orbits **  Points: 1  Mult: 1  MinLength: 0.0000000  MaxLength: 0.0000000
        Prototype of 1 Equivalent Clusters in Orbit 1
            Coordinates:
                0.1528312 0.1332658 0.8040910 H  Va  
        Prototype basis functions:
            \Phi_{1} = \phi_{0,0}(s_{0})

    ** 2 of 7 Orbits **  Points: 1  Mult: 1  MinLength: 0.0000000  MaxLength: 0.0000000
        Prototype of 1 Equivalent Clusters in Orbit 2
            Coordinates:
                0.6534622 0.0623379 0.8040129 H  Va  
        Prototype basis functions:
            \Phi_{2} = \phi_{1,0}(s_{0})

    ** 3 of 7 Orbits **  Points: 1  Mult: 1  MinLength: 0.0000000  MaxLength: 0.0000000
        Prototype of 1 Equivalent Clusters in Orbit 3
            Coordinates:
                0.0037773 0.3244276 0.7884926 H  Va  
        Prototype basis functions:
            \Phi_{3} = \phi_{2,0}(s_{0})

Each branch corresponds to clusters of a certain size, so branch 0 is clusters of size 0 (null term) and branch 1 is clusters of size 1 (point terms). $\Phi_{0} = 1$, so it is the same for all configurations and fitting an ECI to it just produces a constant shift. $\Phi_{1}$, $\Phi_{2}$, and $\Phi_{3}$ actually all correspond to different sites on your (H, Va) sublattice. Because your sites are symmetrically distinct, there are different functions for each site. You can see this where it says Mult: 1, which means multiplicity 1. There are no point terms for the other O and Ru sites because the composition on those sites is fixed.

For comparison, here is what you would get for an HCP prim. In this case, there are two equivalent sites, so there is only one point term and the multiplicity is 2.

** Branch 0 ** 
    ** 0 of 2 Orbits **  Points: 0  Mult: 1  MinLength: 0.00000  MaxLength: 0.00000
        Prototype of 1 Equivalent Clusters in Orbit 0
            Coordinates:
        Prototype basis functions:
            \Phi_{0} = 1

** Branch 1 ** 
    ** 1 of 2 Orbits **  Points: 1  Mult: 2  MinLength: 0.0000000  MaxLength: 0.0000000
        Prototype of 2 Equivalent Clusters in Orbit 1
            Coordinates:
                0.6666667 0.3333333 0.2500000 H  Va  
        Prototype basis functions:
            \Phi_{1} = \phi_{0,0}(s_{0})
  1. To do the kind of iterative fitting that you are describing, you have to use another program to fit such as scikit learn and then write the eci.json yourself.

xivh avatar Dec 01 '23 00:12 xivh