def varassign(v,X,E,rho, argument): 
    """!

    Assigns input to specified gate set variables

    Parameters
    -------
    v : numpy array
        New set of variables
    X : numpy array
        Current gate estimate
    E : numpy array
        Current POVM estimate
    rho : numpy array
        Current initial state estimate
    argument : {"X", "E", "rho"}
        Which part of the gate set is updated

    Returns
    -------
    [.,.,.]: 3 element list
        List in the order [X,E,rho] where either X, E or rho is repaced by v, depending on the input to the "arguement" variable
    """
    if argument == "X" or argument == "K":
        return [v,E,rho]
    elif argument == "E":
        return [X,v,rho]
    elif argument == "rho":
        return [X,E,v]