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
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)
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)
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