def projective_measurement_constraints(*parties):
substitutions = {}<EOL>if isinstance(parties[<NUM_LIT:0>][<NUM_LIT:0>][<NUM_LIT:0>], list):<EOL><INDENT>parties = parties[<NUM_LIT:0>]<EOL><DEDENT>for party in parties:<EOL><INDENT>for measurement in party:<EOL><INDENT>for projector1 in measurement:<EOL><INDENT>for projector2 in measurement:<EOL><INDENT>if projector1 == projector2:<EOL><INDENT>substitutions[projector1**<NUM_LIT:2>] = projector1<EOL><DEDENT>else:<EOL><INDENT>substitutions[projector1*projector2] = <NUM_LIT:0><EOL>substitutions[projector2*projector1] = <NUM_LIT:0><EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>for n1 in range(len(parties)):<EOL><INDENT>for n2 in range(n1+<NUM_LIT:1>, len(parties)):<EOL><INDENT>for measurement1 in parties[n1]:<EOL><INDENT>for measurement2 in parties[n2]:<EOL><INDENT>for projector1 in measurement1:<EOL><INDENT>for projector2 in measurement2:<EOL><INDENT>substitutions[projector2*projector1] =projector1*projector2<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return substitutions<EOL>
Return a set of constraints that define projective measurements.

    :param parties: Measurements of different parties.
    :type A: list or tuple of list of list of
             :class:`sympy.physics.quantum.operator.HermitianOperator`.

    :returns: substitutions containing idempotency, orthogonality and
              commutation relations.