<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import itertools as its\n",
    "import numpy as np\n",
    "    \n",
    "FistSpinConf = np.array([[-2.121, -2.121, 0], [-2.121, 2.121, 0], [2.121, -2.121, 0], [2.121, 2.121, 0]])\n",
    "SpinPermutation=list(its.permutations(FistSpinConf, 4))\n",
    "# a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n"
     ]
    }
   ],
   "source": [
    "f=open('24MAGMOM.txt', 'w')\n",
    "for x in SpinPermutation:\n",
    "    print('MAGMOM = 24*0 12*0', sep=' ', end=' ')\n",
    "    print('MAGMOM = 24*0 12*0', sep=' ', end=' ', file=f)\n",
    "    for y in x:\n",
    "        for z in y:\n",
    "            print(z, sep=' ', end=' ')\n",
    "            print(z, sep=' ', end=' ', file=f)\n",
    "    print('72*0')\n",
    "    print('72*0', file=f)\n",
    "        \n",
    "f.close()"
   ]
  },
  {
   "cell_type": "code",<commit_msg>add a test permutation by starting from coplanar twoin-twoout<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MAGMOM used in DFT for Ba$_2$YOsO$_6$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import itertools as its\n",
    "import numpy as np\n",
    "    \n",
    "FistSpinConf = np.array([[-2.121, -2.121, 0], [-2.121, 2.121, 0], [2.121, -2.121, 0], [2.121, 2.121, 0]])\n",
    "SpinPermutation=list(its.permutations(FistSpinConf, 4))\n",
    "# a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n"
     ]
    }
   ],
   "source": [
    "f=open('24MAGMOM.txt', 'w')\n",
    "for x in SpinPermutation:\n",
    "    print('MAGMOM = 24*0 12*0', sep=' ', end=' ')\n",
    "    print('MAGMOM = 24*0 12*0', sep=' ', end=' ', file=f)\n",
    "    for y in x:\n",
    "        for z in y:\n",
    "            print(z, sep=' ', end=' ')\n",
    "            print(z, sep=' ', end=' ', file=f)\n",
    "    print('72*0')\n",
    "    print('72*0', file=f)\n",
    "        \n",
    "f.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# testing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import itertools as its\n",
    "import numpy as np\n",
    "    \n",
    "FistSpinConf = np.array([[-2.121, 2.121, 0], [2.121, -2.121, 0], [-2.121, -2.121, 0], [2.121, 2.121, 0]])\n",
    "SpinPermutation=list(its.permutations(FistSpinConf, 4)) #The starting is coplanar-twoin-twoout,"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 -2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 -2.121 -2.121 0.0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 -2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 2.121 -2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 -2.121 0.0 -2.121 2.121 0.0 2.121 -2.121 0.0 72*0\n",
      "MAGMOM = 24*0 12*0 2.121 2.121 0.0 -2.121 -2.121 0.0 2.121 -2.121 0.0 -2.121 2.121 0.0 72*0\n"
     ]
    }
   ],
   "source": [
    "f=open('24MAGMOM.txt', 'w')\n",
    "for x in SpinPermutation:\n",
    "    print('MAGMOM = 24*0 12*0', sep=' ', end=' ')\n",
    "    print('MAGMOM = 24*0 12*0', sep=' ', end=' ', file=f)\n",
    "    for y in x:\n",
    "        for z in y:\n",
    "            print(z, sep=' ', end=' ')\n",
    "            print(z, sep=' ', end=' ', file=f)\n",
    "    print('72*0')\n",
    "    print('72*0', file=f)\n",
    "        \n",
    "f.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "2    3\n",
       "dtype: int64"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "from pandas import Series\n",
    "\n",
    "a = Series([1,2,3])\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
{'fraction_non_alphanumeric': 0.2379872678119822, 'fraction_numerical': 0.32475800122089477, 'mean_word_length': 1.7040792265975007, 'pattern_counts': {'":': 61, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2566314', 'n_tokens_mistral': 8234, 'n_tokens_neox': 5919, 'n_words': 1472}