def pauli_constraints(X, Y, Z):
substitutions = {}<EOL>n_vars = len(X)<EOL>for i in range(n_vars):<EOL><INDENT>substitutions[X[i] * X[i]] = <NUM_LIT:1><EOL>substitutions[Y[i] * Y[i]] = <NUM_LIT:1><EOL>substitutions[Z[i] * Z[i]] = <NUM_LIT:1><EOL>substitutions[Y[i] * X[i]] = - X[i] * Y[i]<EOL>substitutions[Z[i] * X[i]] = - X[i] * Z[i]<EOL>substitutions[Z[i] * Y[i]] = - Y[i] * Z[i]<EOL>for j in range(i + <NUM_LIT:1>, n_vars):<EOL><INDENT>substitutions[X[j] * X[i]] = X[i] * X[j]<EOL>substitutions[Y[j] * Y[i]] = Y[i] * Y[j]<EOL>substitutions[Y[j] * X[i]] = X[i] * Y[j]<EOL>substitutions[Y[i] * X[j]] = X[j] * Y[i]<EOL>substitutions[Z[j] * Z[i]] = Z[i] * Z[j]<EOL>substitutions[Z[j] * X[i]] = X[i] * Z[j]<EOL>substitutions[Z[i] * X[j]] = X[j] * Z[i]<EOL>substitutions[Z[j] * Y[i]] = Y[i] * Z[j]<EOL>substitutions[Z[i] * Y[j]] = Y[j] * Z[i]<EOL><DEDENT><DEDENT>return substitutions<EOL>
Return  a set of constraints that define Pauli spin operators.

    :param X: List of Pauli X operator on sites.
    :type X: list of :class:`sympy.physics.quantum.operator.HermitianOperator`.
    :param Y: List of Pauli Y operator on sites.
    :type Y: list of :class:`sympy.physics.quantum.operator.HermitianOperator`.
    :param Z: List of Pauli Z operator on sites.
    :type Z: list of :class:`sympy.physics.quantum.operator.HermitianOperator`.

    :returns: tuple of substitutions and equalities.