This is solvable mechanically
So fun fact, your key design is actually stricter than what's currently on your front door. A standard door look has about 200,000 unique keys, any town with more than 200,000 buildings there are duplicate keys in existence. That aside, let's give a primer on how locks work:
With locks designed lock so:
The lock is reading particular bits of information from the key - you need a key on the corresponding depth so that the slit between red and blue line up allowing the key to rotate. If you don't care about a particular section of the key, just don't put pins in that section.
You can accept multiple values for a pin position by putting a 3rd or subsequent pin in the shaft, eg like so:
You need 1 pin for unique Id within a marriage (person 1 - 5, encoded as height above baseline as 0,1,2,3, or 4), and the remaining pins for the marriage ID. If you give each marriage an 4-pin ID (in base 5), encode male keys as the ID verbatim, and female keys as the inverse of the ID (each pin is the opposite height), you can get complimentary keys, with the last pin making each key unique.
For a 5 pin tumbler lock that only leaves 4 pins for marriage ID. With complimentary pin positions that only leaves 312 polys. So you'll need to add additional pins depending on the number of polycles. 6 pins will give 1500 polys. 7 pins will give ~7800.
The 1 pin for unique ID within the marriage needs to be the "first" one, the one closest to hand when inserted, the marriage Id are the remaining pins closest to the tip. This allows the pins to be read mechanically.
- Private rooms are possible because every key is unique. Private locks check all pins match the required value, just like your standard front door lock.
- Marriage specific rooms (Eg the polys home) ignore the member-in-marriage pin by leaving out the final pin. They have the split pin in each shaft to ensure that both male and female keys work.
- Clergy is just assigned a special marriage ID. All clergy is married to all clergy.
- The "married partner" rooms will have 2 locks, one for a male key, one for a female key, they're complimentary locks. Since the complimentary keys add together they can be inserted in either lock.
Eg, encoding each key as the height above the baseline for each pin position:
- Alice 012345
- Bob 143210
- Carol 212345
- Dave 343210
- Ella 033221
- Fred 122334
- Gertie 233221
- Horace 322334
- the final 5 values for some pairs add up to 55555. That's how we check for married but opposite gender.
- Each key is unique. That's how each person gets their unique room.
- Each poly has the last 5 values equal to one of 2 values, that's how we let polys into their own poly-specific rooms.
- 000000 is not a valid marriage ID - it's given to police (or cleaners) as a master key.
Checking that two keys inserted have the same marriage ID but opposite gender (do the first 5 pins add up to 55555) is accomplished by putting pins in common shafts, like so:
- If only a single key is inserted, it will go all the way in, but only that key can turn, releasing only one lock of 2.
- If two keys of the same gender are attempted to be inserted, the blue pins will block the least inserted key at the second click.
- Two keys with different marriage IDs will not be complementary, so the second key inserted will not advance.
- Two complimentary keys inserted will shift the blue bars back and forth as they advance, and when fully in, they can both turn. Note that the keys need to be inserted in sync, representing the equality of married members to each other. If one gets more than 1 pin in advance of the other it will be held up until the other key catches up.
Socially - I don't think this will work.
As an aside - Every poly I've been in has shared resources, and shared access to the same spaces. We all have duplicates of each others keys. We can drive each others cars and get into each others homes. We can get into each others investment properties and know each others passwords.
This is just for practical reasons, we help each other out as required. But I couldn't keep a private key from my partners if I wanted to - they could easily take and copy it when my guard was down. And my guard is always down around the people I love.
If you offered my poly to pay for the locksmithing services to set this up we'd decline. Mutual trust has benefits, especially with property maintenance and round the house chores. Plus the odd surprise morning cuddles.
Your poly families are likely to be similar - they trust the people they love so allow access to their private spaces.