Searching by formula depends on order


In the main web interface, searching by formula for LiTiMnF6 prompts – or doesn’t prompt – for the rest of the formula as you type depending on the order that you put the elements. E.g. TiMnF … shows only TiMnFe(PO4) as a completion. If you persist and type in the formula it does find the structure, but it is a bit disconcerting not to see the completion! It made me think that the formula was not in the database for several other compounds, so I stopped searching.

1 Like

Thanks for this report. I changed the completion to search on substrings, so that at least e.g. “TiMnF” will show “LiTiMnF6”. The current implementation is optimized for speed, but it’s evident that more flexible, comprehensive completion may be preferable. I’ll look into doing this.

1 Like

@dwinston You could probably brute force it by pre-generating all the possible orderings of elements that the user might type. The number of permutations of strings for each compounds isn’t that much, i.e. N! were N is the number of elements in the compound. Even a 5-element compound only has 120 permutations. For the entire MP database of 60,000 compounds I imagine something like 1 million possible string combinations for all the compounds. It might still be a small enough number to do an autocomplete search.

1 Like

Excellent idea! However, I think the number of possibilities would probably not be all that much more than the number of compounds because you don’t need all the possibilities, just all the unique ones. So LiTiMnF6 will also cover Li, LiTi, and LiTiMn. I.e. the many-element system names will cover many of the binaries, ternaries, etc.

The autocompletion is a very nice feature from the user’s point of view, so I am glad that you can see ways to improve it. Thanks!

1 Like