Author Topic: Does BlochState supports non-collinear calculation?  (Read 5179 times)

0 Members and 1 Guest are viewing this topic.

Offline sukhito teh

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: tw
  • Reputation: 1
    • View Profile
Dear developers and users,
I tried to calculate the blochstate of a Bulkconfiguration with spin orbit coupling exchange correlation, yet the result of bloch state is represented in spin up and spin down values. Though I am able to return a result by projecting to Spin.Z axis, when I tried to perform projection to Spin.Y or Spin.X axis, the following error occurs:
Quote
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    arrayx=bloch_state.spinProjection(spin=Spin.X).toArray()
  File "zipdir/NL/Analysis/GridValues.py", line 1145, in spinProjection
NL.ComputerScienceUtilities.Exceptions.NLValueError: Spin not supported: Spin.X
I had attached the input of calculation.

Thank you for your attention.
« Last Edit: May 20, 2022, 16:21 by sukhito teh »

Offline filipr

  • QuantumATK Staff
  • Heavy QuantumATK user
  • *****
  • Posts: 81
  • Country: dk
  • Reputation: 6
  • QuantumATK developer
    • View Profile
Re: Does BlochState supports non-collinear calculation?
« Reply #1 on: May 23, 2022, 13:23 »
Yes BlochState does support non-collinear spin. However the documentation is a bit confusing on this point: A BlochState is a kind of GridValues object, and GridValues was really mostly designed for representing spin-densities, which really is a combination of a scalar density n(r) and a vector magnetization m(r). A wave function can't be split into such two fields: it is a two component complex spinor field. You can directly access the complex spinor values by using the index operator:
Code
bloch_state = BlochState(...)

spinor_value = bloch_state[i, j, k] # spinor_value will be PhysicalQuantity array of length 2: [up, down]
You can get the dimensions of the grid with:
Code
dimensions = bloch_state.shape
. Also if you are going to do a lot of bloch state analysis I suggest you to first do the DFT SCF ground state and save that to a file, then do the analysis in a separate script like so:
Code
configuration = nlread('my_groundstate_calc.hdf5', BulkConfiguration)[-1]

bloch_state = BlochState(configuration, ...)
Then if there are errors or you need to do multiple bloch state calculations you don't need to redo the expensive SCF calculation.

Offline sukhito teh

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: tw
  • Reputation: 1
    • View Profile
Re: Does BlochState supports non-collinear calculation?
« Reply #2 on: May 24, 2022, 06:59 »
Yes BlochState does support non-collinear spin. However the documentation is a bit confusing on this point: A BlochState is a kind of GridValues object, and GridValues was really mostly designed for representing spin-densities, which really is a combination of a scalar density n(r) and a vector magnetization m(r). A wave function can't be split into such two fields: it is a two component complex spinor field. You can directly access the complex spinor values by using the index operator:
Code
bloch_state = BlochState(...)

spinor_value = bloch_state[i, j, k] # spinor_value will be PhysicalQuantity array of length 2: [up, down]
You can get the dimensions of the grid with:
Code
dimensions = bloch_state.shape
. Also if you are going to do a lot of bloch state analysis I suggest you to first do the DFT SCF ground state and save that to a file, then do the analysis in a separate script like so:
Code
configuration = nlread('my_groundstate_calc.hdf5', BulkConfiguration)[-1]

bloch_state = BlochState(configuration, ...)
Then if there are errors or you need to do multiple bloch state calculations you don't need to redo the expensive SCF calculation.
Thank you for your reply and explanation! Please correct me if I am wrong, do you mean that both the collinear and non collinear spin polarized wavefunctions are represented in  two component complex spinor field (up and down spin respectively)? Is there a way to 'project' the wavefunction to x, y or z components for non-collinear case?

Offline filipr

  • QuantumATK Staff
  • Heavy QuantumATK user
  • *****
  • Posts: 81
  • Country: dk
  • Reputation: 6
  • QuantumATK developer
    • View Profile
Re: Does BlochState supports non-collinear calculation?
« Reply #3 on: May 24, 2022, 09:12 »
In theory the electron wave function is always a two component spinor and it is necessary to represent it as such in the noncollinear and spin-orbit case (note that spin-orbit has nothing to do with the wave function representation, it is just noncollinear spin plus an extra term in the Hamiltonian). In the collinear and unpolarized case we use the fact that we know that the Hamiltonian will not have any spin offdiagonal components to use an effective non-spinor representation of the wave functions: in the polarized case we will have two states Ψ↑ = (ψ↑, 0) and Ψ↓ = (0, ψ↓) which will be the solution to the up Hamiltonian H↑ and the down Hamiltonian H↓, respectively, while in the unpolarized case the up and down Hamiltonian are identical so we have Ψ↑ = (ψ, 0), Ψ↓ = (0, ψ), where ψ is the same and Ψ↑ and Ψ↓ have the same eigenvalue - they are spin degenerate. In these cases we only the scalar ψ part for computational reasons: it reduces the memory and CPU needed (no need to calculate a bunch of zeros).

There is in general no meaningful (x, y, z) projection for wave functions. You kind calculate the expectation value of the spin operator S = ħ/2σ, where σ = (σ_x, σ_y, σ_z) are the Pauli matrices, maybe that is what you mean? Then you get e.g.:

<Ψ|σ_x|Ψ> = (ψ↑*, ψ↓*)([0, 1], [1, 0])(ψ↑, ψ↓) = ψ↑*ψ↓ + ψ↓*ψ↑

I don't think we have ready made functionality to calculate this, but you can do it with the Python API.

Again, the use of the word "projection" for spin-density quantities like electron density is maybe a bit misleading in QuantumATK, but it is historical: it has been called that for 15 years... When calculating e.g. the density we actually calculate the scalar density n(r) and m(r) and combine them into a 2x2 matrix: the spin density. The x-projection is actually just the x-component of the magnetization: m_x(r).

Offline sukhito teh

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: tw
  • Reputation: 1
    • View Profile
Re: Does BlochState supports non-collinear calculation?
« Reply #4 on: May 25, 2022, 05:42 »
Thank you for spending time to explain this simple concept to me. Actually I'm just playing around with different analysis tools of ATK, and your explanation clear up a lot of things for me.