How to use regular expression capabilities in pymatgen query function?

How to use regular expression capabilities in pymatgen query function?

Hello all,
I want to search cubic materials of which ‘reduced_cell_formula’ was ‘**O3’, for example, ‘CaTiO3’, ‘PaTlO3’. But, how to “use Mongo-like language” to match all the materials in pymatgen query function?

The code doesn’t work:
results = m.query(criteria={“crystal_system”: “cubic”, “reduced_cell_formula”: “**O3”,}, properties=[‘cif’])

It raise MPRestError:
pymatgen.ext.matproj.MPRestError: ** is an invalid formula!

If you used query you need to provide a direct mongo query to search on.

If I was looking for things with O3 and two cations I would do something like this:

{"composition.O": 3, "anonymous_formula": "ABC3"}