示例#1
0
    def dirac_notation(self, decimals: int = 2) -> str:
        """Returns the wavefunction as a string in Dirac notation.

        Args:
            decimals: How many decimals to include in the pretty print.

        Returns:
            A pretty string consisting of a sum of computational basis kets
            and non-zero floats of the specified accuracy."""
        return wave_function.dirac_notation(self.state(), decimals)
示例#2
0
    def dirac_notation(self, decimals=2):
        """Returns the wavefunction as a string in Dirac notation.

        Args:
            state: A sequence representing a wave function in which the ordering
                mapping to qubits follows the standard Kronecker convention of
                numpy.kron.
            decimals: How many decimals to include in the pretty print.

        Returns:
            A pretty string consisting of a sum of computational basis kets
            and non-zero floats of the specified accuracy."""
        return wave_function.dirac_notation(self.state, decimals)
示例#3
0
 def dirac_notation(self, decimals=2):
     return wave_function.dirac_notation(self.final_state, decimals)