parameters: (iif, nbeads, momenta=False)
return_statement: return rq
docstring: A file to initialize a vector from an appropriate initializer
     object.
  
     Args:
        iif: An Initializer object specifying the value of a vector.
        nbeads: The number of beads.
        momenta: If bead momenta rather than positions are being initialized
           from a checkpoint file, this is set to True.
docstring_summary: A file to initialize a vector from an appropriate initializer
     object.
docstring_tokens: A file to initialize a vector from an appropriate initializer object .
function: def init_vector(iif, nbeads, momenta=False):
     """A file to initialize a vector from an appropriate initializer
     object.
  
     Args:
        iif: An Initializer object specifying the value of a vector.
        nbeads: The number of beads.
        momenta: If bead momenta rather than positions are being initialized
           from a checkpoint file, this is set to True.
     """
  
     mode = iif.mode; value = iif.value
     if mode == "xyz" or mode == "pdb":
        rq = init_beads(iif, nbeads).q
     elif mode == "chk":
        if momenta: rq = init_beads(iif, nbeads).p
        else:       rq = init_beads(iif, nbeads).q
     elif mode == "manual":
        rq = value
  
     # determines the size of the input data
     if mode == "manual":
        if iif.bead >= 0: # if there is a bead specifier then we return a single bead slice
           nbeads = 1
        natoms = len(rq)/nbeads/3
        rq.shape = (nbeads,3*natoms)
  
     return rq
function_tokens: def init_vector ( iif , nbeads , momenta = False ) : mode = iif . mode value = iif . value if mode == "xyz" or mode == "pdb" : rq = init_beads ( iif , nbeads ) . q elif mode == "chk" : if momenta : rq = init_beads ( iif , nbeads ) . p else : rq = init_beads ( iif , nbeads ) . q elif mode == "manual" : rq = value # determines the size of the input data if mode == "manual" : if iif . bead >= 0 : # if there is a bead specifier then we return a single bead slice nbeads = 1 natoms = len ( rq ) / nbeads / 3 rq . shape = ( nbeads , 3 * natoms ) return rq