docs: def checkInitialState(self,initialState):
          """
          Check whether the initial state is of the correct type.
          The state should be either an int, list, tuple or np.array and all its elements must be integer.
          Returns an int if the state is an integer, otherwise a tuple.
          """
          assert initialState is not None, "Initial state has not been specified."
          assert isinstance(initialState,(int,list,tuple,np.ndarray,set)), "initialState %r is not an int, tuple, list, set or numpy array" % initialState
  
           
          if isinstance(initialState,list): 
              #Check whether all entries of the list are ints. Return an int if the len ==1, otherwise a tuple.
              assert all(isinstance(i, int) for i in initialState), "initialState %r is not integer" % initialState 
              initialState = int(initialState) if len(initialState)==1 else tuple(initialState)          
  
          elif isinstance(initialState,tuple): 
              #Check whether all entries are ints. Return an int if the len ==1, otherwise a tuple.
              assert all(isinstance(i, int) for i in initialState), "initialState %r is not integer" % initialState
              if len(initialState)==1:
                  initialState = int(initialState)     
          
          elif isinstance(initialState,np.ndarray):
              #Check whether the state is a 1d numpy array. Return an int if it has length 1.
              assert issubclass(initialState.dtype.type, np.integer) and initialState.ndim==1, "initialState %r is not a one-dimensional integer numpy array" % initialState 
              initialState = int(initialState) if len(initialState)==1 else tuple(initialState)
              
          elif isinstance(initialState,set):
              #If we have a set, then check whether all elements are ints or tuples.
              for state in initialState:                
                  assert isinstance(state,(tuple,int)), "the set initialState %r should contain tuples or ints" % initialState 
                  if isinstance(state,tuple):
                      assert all(isinstance(i,int) for i in state), "the state %r should be integer" % initialState 
                  
          return initialState