def __call__(self, output_, input_, marginal=None):
if len(output_) != len(input_):<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>elif len(input_) > self.n_parties:<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>elif marginal is None and len(input_) < self.n_parties:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>elif marginal is None:<EOL><INDENT>marginal = self._convert_marginal_index(self.labels)<EOL><DEDENT>else:<EOL><INDENT>marginal = self._convert_marginal_index(marginal)<EOL>if len(marginal) != len(input_):<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>result = S.One<EOL>for party, (proj, meas) in enumerate(zip(output_, input_)):<EOL><INDENT>if len(self.parties[marginal[party]]) < meas + <NUM_LIT:1>:<EOL><INDENT>raise Exception("<STR_LIT>" + str(meas) +<EOL>"<STR_LIT>" + self.labels[party])<EOL><DEDENT>elif len(self.parties[marginal[party]][meas]) < proj:<EOL><INDENT>raise Exception("<STR_LIT>" +<EOL>str(proj) + "<STR_LIT>" + self.labels[party])<EOL><DEDENT>elif len(self.parties[marginal[party]][meas]) == proj:<EOL><INDENT>result *= S.One -sum(op for op in self.parties[marginal[party]][meas])<EOL><DEDENT>else:<EOL><INDENT>result *= self.parties[marginal[party]][meas][proj]<EOL><DEDENT><DEDENT>return result<EOL>
Obtain your probabilities in the p(ab...|xy...) notation.

        :param output_: Conditional output as [a, b, ...]
        :type output_: list of ints.
        :param input_: The input to condition on as [x, y, ...]
        :type input_: list of ints.
        :param marginal: Optional parameter. If it is a marginal, then you can
                         define which party or parties it belongs to.
        :type marginal: list of str.
        :returns: polynomial of `sympy.physics.quantum.HermitianOperator`.

        :Example:

        For the CHSH scenario, to get p(10|01), write

            P([1,0], [0,1])

        To get the marginal p_A(0|1), write

            P([0], [1], ['A'])