Ejemplo n.º 1
0
    def truth_table(self):
        """Returns (and computes) the truth table"""
        if self._truth_table is None:
            from tweedledum.classical import simulate  # pylint: disable=no-name-in-module

            self._truth_table = simulate(self._network)
        return self._truth_table
Ejemplo n.º 2
0
    def simulate(self, bitstring: str) -> bool:
        """Evaluate the expression on a bitstring.

        This evaluation is done classically.

        Args:
            bitstring: The bitstring for which to evaluate.

        Returns:
            bool: result of the evaluation.
        """
        return simulate(self._network, bitstring)
Ejemplo n.º 3
0
    def simulate(self, bitstring: str) -> bool:
        """Evaluate the expression on a bitstring.

        This evaluation is done classically.

        Args:
            bitstring: The bitstring for which to evaluate.

        Returns:
            bool: result of the evaluation.
            """
        from tweedledum.classical import simulate  # pylint: disable=no-name-in-module
        return simulate(self._network, bitstring)
Ejemplo n.º 4
0
 def truth_table(self):
     """Returns (and computes) the truth table"""
     if self._truth_table is None:
         self._truth_table = simulate(self._network)
     return self._truth_table