I have a perfect supercell structure Ni fcc. And I would like to dope another element O or N with a ratio of O:Ni=8:100 to the supercell of 3x3x3 and find the most stable ordering structure. The number of possible configurations is extremely large. I would like to ask if you know any code to generate all possible cases and remove of similar cases?
I will give a secondary answer that does not involve USPEX. Realistically, picking about 8 atoms out of 108 requires you to test 352,025,629,371 combinations. This is obviously too much to handle. You can try one of two approaches.
Randomly sample the entire space, probably not that difficult to do but no promises you get a good result. ASE can help you do this fairly easily and this can be run in a highly parallel manner. With so many combinations to pick from, you will be unlikely to generate two of the same combination (although with translations and rotations etc you will probably generate some). If we assume no symmetry is possible, picking 10,000 random cells you will only have a 0.014201% chance of generating two of the same cells.
Go from 1:107 ratio to 2:106 to 3:105, etc. You can actually brute force this type of solution relatively quickly with modern hardware and reasonable calculation parameters, just by only keeping the top 5% of structures to add an additional dopant. This type of solution is heavily helped by symmetry finding. Here are two methods of this.
- Niggli reduce each cell, compare if they align the same by element and position (assuming unrelaxed cell)
- Look at the coordination shell of the dopants. See if all dopants see a similar coordination shell. For example, if the oxygen is surrounded by Ni on all sides. I have actually developed a code which can do this for multiple coordination shells. The documentation is not so good at the moment but this will be fixed eventually hopefully. Currently its designed to handle surfaces, not bulk, but this can be changed easily. For now you may want to look at our paper to understand exactly whats going on.
- Look into full python packages capable of doing this, pymatgen and ase both have some functionality for this.
You have too large of a search space for this to be exhaustive though no matter what you do. Consider using a different approach for making supercells that allows you to have less atoms but still keep them separated in space. You may be able to do a 4:50 cell for example instead.
I also won't explore it in this answer, but there are lots of genetic algorithms for this sort of thing as well, but I have never used them. I will link an example from ASE.
ATAT (Alloy Theoretic Automated Toolkit)
ATAT is a software is specialized in solving such issues.
It has a module to generate Special Quasirandom Structures (SQS), used to simulate disordered solid solutions as your case.
What you intend to do is crystal structure prediction (CSP). Just yesterday, I got to know about a crystal structure prediction blind-test that the Cambridge Crystallographic Data Centre organises through this answer by one of my favourite people here on this stack exchange.
Personally, I have some experience using USPEX. CSP is simply a global optimization problem in terms of the potential energy surface of the material. USPEX uses fingerprinting to make the search faster by eliminating similar structures. Many other interesting features in the code help make the search more robust and efficient.
About your question, did you mean a ratio of N,O:Ni = $8:100$? And why is there a necessity for a 3x3x3 supercell?
SOD (Site-Occupation Disorder code)
I found that SOD code can help to do it well.
Cluster Expansion Codes
Several codes can help with fitting a cluster expansion (CE) to this problem. A cluster expansion uses (small-cell) computed DFT energies and maps them to short-range multi-body cluster interactions on the assumption that all species occupy lattice sites. In this particular example, the assumption will be that the O occupy some well-defined interstitial sites. The codes will take care of the symmetry elements in generating the reference structures for DFT, see e.g. structure enumeration in ICET linked below. The upside of using a cluster expansion is that it eliminates the need to try all the available structures. You can start training the cluster expansion with something like 50, then add structures and re-train as needed until test / validation errors are acceptable.
Ultimately, from small-cell reference computations, once the CE is well-trained, an arbitrarily large cell can be extrapolated, and its ground state (lowest-energy ordering) found by simulated annealing.