## Posts

### Notes On Isotropy Subgroup

Isotropy subgroup [1] This blog contains some key notes for reading the lecture notes by H. Stokes, et al. [1] on isotropy subgroup. Details about the lecture notes will not be reproduced here and instead we will just put down some key understanding as below, Two subspaces are equivalent if the basis vectors for each can be set up in such a way that they are associated with the same representation. The reason why the two subspaces are equivalent is that it is actually the linear combination coefficients that appear in front of the basis vectors that determines how the symmetry is lowered. Even though the basis vectors of the two subspaces may be very different, the same linear combination of basis vectors still lead to the same variation of symmetry, e.g., lowering the space group from $$G$$ to its subgroup $$G'$$. This might be the reason why subgroups associated with vectors in parameter space are called isotropy subgroup  -- atomic distortions in the two equivalent subspaces cou
Recent posts

### Set up OwnCloud server on Windows with WSL

I was following the instructions presented in Ref [1, 2] to set up the OwnCloud server on Windows with WSL. Specifically, steps [1-8] in Ref. [1] were followed exactly - the installation for WSL was, however, installed separately. Then concerning the SQL database setup, the 'MySQL' section in Ref. [2] was followed. Also, the installation of ownCloud server refers to the 'Download ownCloud' section in Ref. [2] as well. All steps beyond steps [1-8] in Ref. [1] and 'MySQL' and 'Download ownCloud' in Ref. [2] were skipped. To access the configuration of owncloud, refer to the section 'Configure ownCloud' in Ref. [2]. 👉Ports configuration Refer to the following links to gist for configuration files concerning the ports configuration, /etc/apache2/ports.conf /etc/apache2/sites-enabled/000-default.conf 👉Connection to WSL Apache server from outside (i.e., beyond localhost) This link provide detailed explanation about the IP address assignment scheme f

### Implementation of nano-size effect correction for modeling PDF

Simulation box for bulk (left) and nano (right) systems In Ref. [1], we discussed the theoretical principles for correcting the nano-size effect when modeling the pair distribution function (PDF). The fundamental idea is to bring back the uncorrelated pairings in between atoms belong to different nanoparticles, based on the assumption of random distribution of nanoparticles in system. Such uncorrelated pairings will then be added to the partial PDF's calculated explicitly from the structural model in simulation box, as presented in the right of the picture shown above. The kernel mathematical expression in Ref. [1] is reproduced as follows, $G(r) = \sum_{i,j}c_ic_jf_if_j[\frac{\rho^{RMC}}{\rho}g_{ij}^{RMC}(r) + U(r) - 1]$ where the meaning of all symbols can be found in Ref. [1] and we won't reproduce them all here. Instead, we are going to focus on the term $$g_{ij}^{RMC}(r)$$ which represents the partial PDF's calculated explicitly from the simulation box and $$U(r)$$ w

### Coherent and incoherent scattering length of neutron

Neutron scattering length table by NIST [1] When we do calculations relevant to neutron scattering, it is unavoidable that we will come across either coherent, incoherent or total scattering length of elements, which describes the strength of scattering neutrons by different elements, either coherently, incoherently or both. In this article, I will try to uncover the three different types of neutron scattering length, by going through the derivation in details. First, the differential cross section for neutron scattering by a certain structure is given as below -- here we do the derivation for a single-species system so we can derive the relevant scattering length conveniently. $\frac{d\sigma}{d\Omega} = \sum_{i,j}b_ib_je^{-i\vec{Q}\cdot (\vec{R}_i - \vec{R}_j)}$ where $$i$$, $$j$$ refers to atoms located at different locations in the structure under beam. In practice, every single $$b_i$$, $$b_j$$ depends on the corresponding nuclear isotope, spin orientation relative to neutron, nu

### Notes on topological physics

Image reproduced from Ref. [5]. In this blog, I will put down my learning notes as reading through the article on topological electrons by A. P. Ramirez and B. Skinner [1]. Basically, I will follow the story flow in Ref. [1] and therefore, first, I will note down the main flow that one can follow to arrive at the notion of topological electrons. Then I will cover the implications of topology and its connection to quantum Hall effect and quantum spin Hall effect. Finally, Weyl semimetal will be covered. It should be pointed that I will not reproduce all the nice discussions presented in Ref. [1]. Rather instead, I will just try to note down those key points or questions that I came across during reading Ref. [1]. First, the topological structure of an geometric object is defined by the Gauss-Bonnet integral, $\frac{1}{2\pi}\int_S K dA = n$ where $$K$$ refers to the curvature at points on surface $$A$$. The integral will give us a constant $$n$$ which corresponds to the genus (number o

### Notes on Ising model

Ernst Ising (Left) and Wilhelm Lenz (Right) - Ising was Lenz's student and the Ising model was claimed (by Ising himself) to be originated by Lenz but named after Ising. Ising model was originally proposed for ferromagnetism and owing to its simplicity in describing the system interaction, it has been widely used in not only describing magnetic systems in theoretical physics area but also in other areas involving similar interaction mechanism. In fact, Ising model can potentially find its position in describing systems involving binary states whereby we have active influence upon each other between neighbors. Here in this blog, I will not try to reproduce those already available beautiful introduction to Ising model - see e.g., Ref. [1-4] and a whole bunch of others one can easily find on Internet. Instead, I will just write down the outline of the problem we are facing once we have the simple Ising model set up for describing the system energy. For example, we always hear people t

### Management of Jupyter kernels

Having multiple kernels available for Jupyter service, we may need to manage them at some point, e.g., rename kernel names and remove kernels. First, to show all available kernels, run the following command, jupyter kernelspec list we will then see output like this, Available kernels:   python3    /opt/jupyterhub/lib64/python3.6/site-packages/ipykernel/resources   diffpy     /usr/local/share/jupyter/kernels/diffpy   py37       /usr/local/share/jupyter/kernels/py37   python     /usr/local/share/jupyter/kernels/python This is the full list of all available kernels on our machine and the directory specifies where the configuration file for each kernel is located. To change kernel name, we then need to go into the corresponding directory for a specific kernel and open the 'kernel.json' file to change the 'display_name' entry to whatever we want. To remove a kernel, we want to use the following command, jupyter kernelspec remove KERNEL_NAME For example, if we want to remove

### Conda environment to be used as Jupyterlab kernel across users

When trying to set up our own Jupyterlab server where general users can visit and use, the link in Ref. [1] could be followed. Once we follow literally the step-1 specified in the link, the server should be running without problem and we can just start using our own online Jupyterlab service. However, since the Jupyterlab service we just set up is a system-wise available service and therefore when we want to add kernels to the Jupyterlab service, we cannot use those kernels belonging to a specific user. Instead, we should set up system-wise available environment which then can be used as system-wise available kernels. The step-2 in Ref. [1] provides us with a generic way to set up the system-wise available environment using conda . Definitely we can follow the instructions there to set up conda in such way that conda itself is also system-wise available. As an alternative, we can be a bit flexible - we can use general users' local conda environment to do this as well, as long as

### Documentation with docstrings in Python

Docstring is part of Python script which will keep record of documentation and description of the relevant section in the script. It won't make any effect upon the execution of the script but whenever needed, the docstring could be pulled out and displayed for users' reference. Based on that, we can go further to generate dedicated documentation pages/docs for general purpose. At this point, Sphinx is a commonly used package to transform the docstrings in Python script into either HTML, LaTeX or some other suitable formats. Here in this blog, I am going to write down some notes in using Sphinx for building documentation based on the docstring in Python scripts. The steps below could be used as sort of general guidance to set things up with Sphinx. 1. Installation The official link to Sphinx gives rather detailed instructions about the installation and here I am not going to reproduce those details - refer to Ref. [1]. 2. Initial setup Once Sphinx is installed, we may want to se

### Notes on magnetism III - Various physical quantities describing magnetic field

Talking about magnetic field, we have three relevant physical quantities - magnetic field $$\vec{H}$$, magnetic induction field $$\vec{B}$$ and magnetization field $$\vec{M}$$. It is straightforward to understand $$\vec{M}$$ - when applying magnetic field (here, by 'magnetic field', we mean something in general, but not specifically refer to $$\vec{H}$$), we use $$\vec{M}$$ to characterize how much the matter in question is magnetized. However, concerning $$\vec{H}$$ and $$\vec{B}$$, it seems that both are describing some sort of 'strength' of magnetic field (again, we mean 'magnetic field' in general. The same applies below until we become specific about what we mean by 'magnetic field'). But why do we have two quantities here to describe the 'same' thing? The answer is - they are not the same thing, as described by $$\vec{H}$$ and $$\vec{B}$$, respectively. Fundamentally, this goes back to the foundation of the electromagnetic theory - specific

### Why do we have spin half for electrons?

Illustration for Stern-Glach experiment [1] Angular moment means rotation - this applies to electron as well. For electrons, any movement is associated with current and therefore angular moment naturally is tightly linked to current as well. Furthermore, current means magnetic field, as originated by Orsted. Mathematically, starting from expressing the current with the angular moment of rotating electrons, followed by detailed mathematics based on Biot-Savart law (induction $$\vec{B}$$ as the function of current), one can arrive at the expression of magnetic induction in terms of magnetic (dipole) moment $$\vec{m}_l$$. In another word, it can be shown that the magnetic field generated by electron rotation current is equivalent to that generated by magnetic dipole, with the equivalent dipole moment defined as (see Ref. [2] for detailed derivation), $\vec{m}_l = -\frac{1}{2}eR^2\vec{\omega}$ Given that the angular moment can be written as $$\vec{l} = m_eR^2\vec{\omega}$$, we can obtain