class_docstr: Base class for Qubit and QubitBra.
class_docstr_tok: ["Base","class","for","Qubit","and","QubitBra","."]
code: def _eval_args(cls, args):
      # If we are passed a QubitState or subclass, we just take its qubit
      # values directly.
      if len(args) == 1 and isinstance(args[0], QubitState):
          return args[0].qubit_values
  
      # Turn strings into tuple of strings
      if len(args) == 1 and isinstance(args[0], str):
          args = tuple(S.Zero if qb == "0" else S.One for qb in args[0])
      else:
          args = tuple(
              S.Zero if qb == "0" else S.One if qb == "1" else qb
              for qb in args
          )
      args = tuple(_sympify(arg) for arg in args)
  
      # Validate input (must have 0 or 1 input)
      for element in args:
          if element not in (S.Zero, S.One):
              raise ValueError(
                  "Qubit values must be 0 or 1, got: %r" % element
              )
      return args
  
imports: import math
  from sympy.core.add import Add
  from sympy.core.mul import Mul
  from sympy.core.numbers import Integer
  from sympy.core.power import Pow
  from sympy.core.singleton import S
  from sympy.functions.elementary.complexes import conjugate
  from sympy.functions.elementary.exponential import log
  from sympy.core.basic import _sympify
  from sympy.external.gmpy import SYMPY_INTS
  from sympy.matrices import Matrix, zeros
  from sympy.printing.pretty.stringpict import prettyForm
  from sympy.physics.quantum.hilbert import ComplexSpace
  from sympy.physics.quantum.state import Ket, Bra, State
  from sympy.physics.quantum.qexpr import QuantumError
  from sympy.physics.quantum.represent import represent
  from sympy.physics.quantum.matrixutils import numpy_ndarray, scipy_sparse_matrix
  from mpmath.libmp.libintmath import bitcount
label_desc: Use image node_id 1 for calling the QubitState obj's underlying member method code with example usage: obj._eval_args(cls, args) and returns: args, args