I’d like to retrieve data for all binary, ternary, etc. compounds whose elements belong to specific lists (i.e., excluding all other elements). For example, how do I retrieve data for a binary compound made of elements from groups 1 and 2 in the Periodic Table? That is, one element has to belong to group 1 and the other from group 2, and they can’t belong to any group other than 1 and 2. Other examples:
- A binary compound with both elements from group 3.
- A ternary compound with elements from groups 1, 3, and 4.
- A ternary compound with elements from groups 2, 2, and 5 (i.e., two different elements must be from the same group 2).
The Python script looks something like this:
criteria = {"nelements": {"$eq": 2}, "elasticity": {"$exists": True}, "spacegroup.number": {"$exists": True}, "band_gap": {"$exists": True}, "elements": {"$in": ???, "$nin": ???}}
results = m.query(criteria=criteria, properties=properties)
The ???
indicate lists, but that I’m not sure if it’s correct. I tried a few things, but I’m not able to include/exclude elements as needed.
Thank you.
P.S.: The number of elements does need to be a strict criterion. For example, I could use "nelements": {"$lte": 4}
and specify that the elements must belong to groups 1 and 4 only.