To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 7389f941 authored by spiasko's avatar spiasko
Browse files

ex11 gelöst

parent f88897db
......@@ -26,18 +26,15 @@
"source": [
"## Crystallographic point groups"
]
},
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"14 P 21/c\n",
" setting 1\n",
......@@ -148,33 +145,40 @@
" return Atoms(cell=cell[0],\n",
" scaled_positions=cell[1],\n",
" numbers=cell[2])"
]
},
{
"cell_type": "code",
"execution_count": 19,
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"def a_equiv_b(a,b):\n",
" \"\"\"Function that identifies whether two crystals are equivalent\"\"\"\n",
"\n",
" # getting symmetry datasets for both crystals\n",
" cryst_a = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=a), symprec=1e-5, angle_tolerance=-1.0, hall_number=0)\n",
" cryst_b = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=b), symprec=1e-5, angle_tolerance=-1.0, hall_number=0)\n",
"\n",
" cryst_b = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=b), symprec=1e-5, angle_tolerance=-1.0, hall_number=0)\n",
" samecell = np.allclose(cryst_a['std_lattice'], cryst_b['std_lattice'], atol=1e-5)\n",
" samenatoms = len(cryst_a['std_positions']) == len(cryst_b['std_positions'])\n",
" samespg = cryst_a['number'] == cryst_b['number']\n",
" \n",
" def test_rotations_translations(cryst_a, cryst_b, repeat):\n",
" cell = cryst_a['std_lattice']\n",
" pristine = crystal('Mg', [(0, 0., 0.)], \n",
" spacegroup=int(cryst_a['number']),\n",
" cellpar=[cell[0]/repeat[0], cell[1]/repeat[1], cell[2]/repeat[2]]).repeat(repeat)\n",
"\n",
" sym_set_p = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=pristine), symprec=1e-5,\n",
" angle_tolerance=-1.0, hall_number=0)\n",
"\n",
" for _,trans in enumerate(zip(sym_set_p['rotations'], sym_set_p['translations'])):\n",
" pnew=(np.matmul(trans[0],cryst_a['std_positions'].T).T + trans[1]) % 1.0\n",
" fulln = np.concatenate([cryst_a['std_types'][:, None], pnew], axis=1)\n",
" cellpar=[cell[0]/repeat[0], cell[1]/repeat[1], cell[2]/repeat[2]]).repeat(repeat)\n",
" fullb = np.concatenate([cryst_b['std_types'][:, None], cryst_b['std_positions']], axis=1)\n",
" sorted_n = np.array(sorted([ list(row) for row in list(fulln) ]))\n",
" sorted_b = np.array(sorted([ list(row) for row in list(fullb) ]))\n",
" if np.allclose(sorted_n, sorted_b, atol=1e-5):\n",
" sym_set_p = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=pristine), symprec=1e-5,\n",
" angle_tolerance=-1.0, hall_number=0)\n",
"\n",
" for _,trans in enumerate(zip(sym_set_p['rotations'], sym_set_p['translations'])):\n",
" return True\n",
" return False\n",
......
......@@ -20,20 +20,20 @@
"import nglview"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Crystallographic point groups"
 
},
 
"cell_type": "code",
"metadata": {},
"source": [
"## Crystallographic point groups"
 
},
 
"cell_type": "code",
"execution_count": 3,
"metadata": {},
 
 
{
"name": "stdout",
"output_type": "stream",
"text": [
"14 P 21/c\n",
......@@ -158,12 +158,18 @@
"\n",
" # getting symmetry datasets for both crystals\n",
" cryst_a = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=a), symprec=1e-5, angle_tolerance=-1.0, hall_number=0)\n",
" cryst_b = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=b), symprec=1e-5, angle_tolerance=-1.0, hall_number=0)\n",
"\n",
" samecell = np.allclose(cryst_a['std_lattice'], cryst_b['std_lattice'], atol=1e-5)\n",
" samecell = np.allclose(cryst_a['std_lattice'], cryst_b['std_lattice'], atol=1e-5)\n",
" samenatoms = len(cryst_a['std_positions']) == len(cryst_b['std_positions'])\n",
" samespg = cryst_a['number'] == cryst_b['number']\n",
" \n",
" def test_rotations_translations(cryst_a, cryst_b, repeat):\n",
" cell = cryst_a['std_lattice']\n",
" pristine = crystal('Mg', [(0, 0., 0.)], \n",
" spacegroup=int(cryst_a['number']),\n",
" cellpar=[cell[0]/repeat[0], cell[1]/repeat[1], cell[2]/repeat[2]]).repeat(repeat)\n",
"\n",
" sym_set_p = spglib.get_symmetry_dataset(ase_to_spgcell(ase_atoms=pristine), symprec=1e-5,\n",
" angle_tolerance=-1.0, hall_number=0)\n",
"\n",
......
This diff is collapsed.
This diff is collapsed.
&control
verbosity='high'
calculation='scf'
restart_mode='from_scratch'
prefix='SI'
pseudo_dir = './',
outdir='./'
wf_collect=.true.
/
&system
ibrav=1
celldm(1)=10.26121694631474912930
nat=8,
ntyp=1,
ecutwfc = 30,
occupations='smearing',
degauss=0.001
/
&electrons
conv_thr = 1.0e-8
mixing_beta = 0.5
/
&ions
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-mt_fhi.UPF
ATOMIC_POSITIONS crystal
Si 0.000000 0.000000 0.000000
Si 0.000000 0.500000 0.500000
Si 0.500000 0.000000 0.500000
Si 0.500000 0.500000 0.000000
Si 0.750000 0.250000 0.750000
Si 0.250000 0.250000 0.250000
Si 0.250000 0.750000 0.750000
Si 0.750000 0.750000 0.250000
K_POINTS automatic
1 1 1 0 0 0
This diff is collapsed.
#!/bin/bash --login
#SBATCH --job-name="TASK_0"
#SBATCH --nodes=1 # the number of ranks (total)
#SBATCH --ntasks-per-node=12 # the number of ranks per node
##SBATCH --ntasks-per-core=1 # enable this if you want hyperthreading
#SBATCH --cpus-per-task=1 # use this for threaded applications
#SBATCH --time=00:10:00
#SBATCH --constraint=gpu
#SBATCH --account=YOUR_ACCOUNT
##SBATCH --partition=normal
#SBATCH --output="c1"
module load daint-gpu
export CRAY_CUDA_MPS=1
module load QuantumESPRESSO/6.3-CrayIntel-18.08
#======START=====
a=5.43
alat=`echo "${a} / 0.529177" | bc -l`
cat >pw.in << EOF
&control
verbosity='high'
calculation='scf'
restart_mode='from_scratch'
prefix='SI'
pseudo_dir = './',
outdir='./'
wf_collect=.true.
/
&system
ibrav=1
celldm(1)=${alat}
nat=8,
ntyp=1,
ecutwfc = 30,
occupations='smearing',
degauss=0.001
/
&electrons
conv_thr = 1.0e-8
mixing_beta = 0.5
/
&ions
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-mt_fhi.UPF
ATOMIC_POSITIONS crystal
Si 0.000000 0.000000 0.000000
Si 0.000000 0.500000 0.500000
Si 0.500000 0.000000 0.500000
Si 0.500000 0.500000 0.000000
Si 0.750000 0.250000 0.750000
Si 0.250000 0.250000 0.250000
Si 0.250000 0.750000 0.750000
Si 0.750000 0.750000 0.250000
K_POINTS automatic
1 1 1 0 0 0
EOF
srun -n $SLURM_NTASKS --ntasks-per-node=$SLURM_NTASKS_PER_NODE -c $SLURM_CPUS_PER_TASK --cpu_bind=rank --hint=nomultithread pw.x <pw.in > si.out
This diff is collapsed.
&control
verbosity='high'
calculation='scf'
restart_mode='from_scratch'
prefix='SI'
pseudo_dir = './',
outdir='./'
wf_collect=.true.
/
&system
ibrav=1
celldm(1)=10.26121694631474912930
nat=8,
ntyp=1,
ecutwfc = 30,
occupations='smearing',
degauss=0.001
/
&electrons
conv_thr = 1.0e-8
mixing_beta = 0.5
/
&ions
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-mt_fhi.UPF
ATOMIC_POSITIONS crystal
Si 0.000000 0.000000 0.000000
Si 0.000000 0.500000 0.500000
Si 0.500000 0.000000 0.500000
Si 0.500000 0.500000 0.000000
Si 0.750000 0.250000 0.750000
Si 0.250000 0.250000 0.250000
Si 0.250000 0.750000 0.750000
Si 0.750000 0.750000 0.250000
K_POINTS automatic
2 2 2 0 0 0
This diff is collapsed.
#!/bin/bash --login
#SBATCH --job-name="TASK_0b"
#SBATCH --nodes=1 # the number of ranks (total)
#SBATCH --ntasks-per-node=12 # the number of ranks per node
##SBATCH --ntasks-per-core=1 # enable this if you want hyperthreading
#SBATCH --cpus-per-task=1 # use this for threaded applications
#SBATCH --time=00:10:00
#SBATCH --constraint=gpu
#SBATCH --account=YOUR_ACCOUNT
##SBATCH --partition=normal
#SBATCH --output="c1"
module load daint-gpu
export CRAY_CUDA_MPS=1
module load QuantumESPRESSO/6.3-CrayIntel-18.08
a=5.43
alat=`echo "${a} / 0.529177" | bc -l`
cat >pw.in << EOF
&control
verbosity='high'
calculation='scf'
restart_mode='from_scratch'
prefix='SI'
pseudo_dir = './',
outdir='./'
wf_collect=.true.
/
&system
ibrav=1
celldm(1)=${alat}
nat=8,
ntyp=1,
ecutwfc = 30,
occupations='smearing',
degauss=0.001
/
&electrons
conv_thr = 1.0e-8
mixing_beta = 0.5
/
&ions
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-mt_fhi.UPF
ATOMIC_POSITIONS crystal
Si 0.000000 0.000000 0.000000
Si 0.000000 0.500000 0.500000
Si 0.500000 0.000000 0.500000
Si 0.500000 0.500000 0.000000
Si 0.750000 0.250000 0.750000
Si 0.250000 0.250000 0.250000
Si 0.250000 0.750000 0.750000
Si 0.750000 0.750000 0.250000
K_POINTS automatic
2 2 2 0 0 0
EOF
srun -n $SLURM_NTASKS --ntasks-per-node=$SLURM_NTASKS_PER_NODE -c $SLURM_CPUS_PER_TASK --cpu_bind=rank --hint=nomultithread pw.x <pw.in > si.out
This diff is collapsed.
&control
verbosity='high'
calculation='scf'
restart_mode='from_scratch'
prefix='SI'
pseudo_dir = './',
outdir='./'
wf_collect=.true.
/
&system
ibrav=1
celldm(1)=10.26121694631474912930
nat=8,
ntyp=1,
ecutwfc = 30,
occupations='smearing',
degauss=0.001
/
&electrons
conv_thr = 1.0e-8
mixing_beta = 0.5
/
&ions
/
ATOMIC_SPECIES
Si 28.086 Si.pbe-mt_fhi.UPF
ATOMIC_POSITIONS crystal
Si 0.000000 0.000000 0.000000
Si 0.000000 0.500000 0.500000
Si 0.500000 0.000000 0.500000
Si 0.500000 0.500000 0.000000
Si 0.750000 0.250000 0.750000
Si 0.250000 0.250000 0.250000
Si 0.250000 0.750000 0.750000
Si 0.750000 0.750000 0.250000
K_POINTS automatic
2 2 2 1 1 1
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment