def dirac_str_to_int(dirac_str):
    """Converts a string in Dirac notation to an integer

    This will work for the computational basis only.
    Example: |1001> = 9

    Args:
        dirac_str: something like "|1001>"
    """
    return int(dirac_str[1:-1], 2)
