def make_upccgsd_ansatz(self, include_reference: bool=True, name: str='UpCCGSD', label: str=None, order: int=None, assume_real: bool=True, hcb_optimization: bool=None, spin_adapt_singles: bool=True, neglect_z=False, *args, **kwargs):
    '\n        UpGCCSD Ansatz similar as described by Lee et. al.\n\n        Parameters\n        ----------\n        include_singles\n            include singles excitations. Is overwritten if indices are a string (i.e. indices=UpCCGSD will always include singles, UpCCGD will not)\n        include_reference\n            include the HF reference state as initial state\n        indices\n            pass custom defined set of indices from which the ansatz will be created\n            List of tuples of tuples spin-indices e.g. [((2*p,2*q),(2*p+1,2*q+1)), ...]\n        label\n            An additional label that is set with the variables\n            default is None and no label will be set: variables names will be\n            (x, (p,q)) for x in range(order)\n            with a label the variables will be named\n            (label, (x, (p,q)))\n        order\n            Order of the ansatz (default is 1)\n            determines how often the ordering gets repeated\n            parameters of repeating layers are independent\n        assume_real\n            assume a real wavefunction (that is always the case if the reference state is real)\n            reduces potential gradient costs from 4 to 2\n        Returns\n        -------\n            UpGCCSD ansatz\n        '
    name = name.upper()
    if (('A' in name) and (neglect_z is None)):
        neglect_z = True
    else:
        neglect_z = False
    if (order is None):
        try:
            if ('-' in name):
                order = int(name.split('-')[0])
            else:
                order = 1
        except:
            order = 1
    indices = self.make_upccgsd_indices(key=name)
    have_hcb_trafo = (self.transformation.hcb_to_me() is not None)
    if (have_hcb_trafo and (hcb_optimization is None)):
        hcb_optimization = True
    if ('HCB' in name):
        hcb_optimization = True
    if (hcb_optimization and (not have_hcb_trafo) and ('HCB' not in name)):
        raise TequilaException("use_hcb={} but transformation={} has no 'hcb_to_me' function. Try transformation='ReorderedJordanWigner'".format(hcb_optimization, self.transformation))
    if (('S' in name) and ('HCB' in name)):
        if (('HCB' in name) and ('S' in name)):
            raise Exception("name={}, Singles can't be realized without mapping back to the standard encoding leave S or HCB out of the name".format(name))
    if (not hcb_optimization):
        U = QCircuit()
        if include_reference:
            U = self.prepare_reference()
        U += self.make_upccgsd_layer(*args, include_singles=('S' in name), indices=indices, assume_real=assume_real, label=(label, 0), spin_adapt_singles=spin_adapt_singles, **kwargs)
    else:
        U = QCircuit()
        if include_reference:
            U = self.prepare_hardcore_boson_reference()
        U += self.make_hardcore_boson_upccgd_layer(*args, indices=indices, assume_real=assume_real, label=(label, 0), **kwargs)
        if ('HCB' not in name):
            U = self.hcb_to_me(U=U)
        if ('S' in name):
            U += self.make_upccgsd_singles(*args, indices=indices, assume_real=assume_real, label=(label, 0), spin_adapt_singles=spin_adapt_singles, neglect_z=neglect_z, **kwargs)
    for k in range(1, order):
        U += self.make_upccgsd_layer(include_singles=('S' in name), indices=indices, label=(label, k), spin_adapt_singles=spin_adapt_singles, neglect_z=neglect_z)
    return U
UpGCCSD Ansatz similar as described by Lee et. al.

Parameters
----------
include_singles
    include singles excitations. Is overwritten if indices are a string (i.e. indices=UpCCGSD will always include singles, UpCCGD will not)
include_reference
    include the HF reference state as initial state
indices
    pass custom defined set of indices from which the ansatz will be created
    List of tuples of tuples spin-indices e.g. [((2*p,2*q),(2*p+1,2*q+1)), ...]
label
    An additional label that is set with the variables
    default is None and no label will be set: variables names will be
    (x, (p,q)) for x in range(order)
    with a label the variables will be named
    (label, (x, (p,q)))
order
    Order of the ansatz (default is 1)
    determines how often the ordering gets repeated
    parameters of repeating layers are independent
assume_real
    assume a real wavefunction (that is always the case if the reference state is real)
    reduces potential gradient costs from 4 to 2
Returns
-------
    UpGCCSD ansatz
def make_upccgsd_ansatz(self, include_reference: bool=True, name: str='UpCCGSD', label: str=None, order: int=None, assume_real: bool=True, hcb_optimization: bool=None, spin_adapt_singles: bool=True, neglect_z=False, *args, **kwargs):
    '\n        UpGCCSD Ansatz similar as described by Lee et. al.\n\n        Parameters\n        ----------\n        include_singles\n            include singles excitations. Is overwritten if indices are a string (i.e. indices=UpCCGSD will always include singles, UpCCGD will not)\n        include_reference\n            include the HF reference state as initial state\n        indices\n            pass custom defined set of indices from which the ansatz will be created\n            List of tuples of tuples spin-indices e.g. [((2*p,2*q),(2*p+1,2*q+1)), ...]\n        label\n            An additional label that is set with the variables\n            default is None and no label will be set: variables names will be\n            (x, (p,q)) for x in range(order)\n            with a label the variables will be named\n            (label, (x, (p,q)))\n        order\n            Order of the ansatz (default is 1)\n            determines how often the ordering gets repeated\n            parameters of repeating layers are independent\n        assume_real\n            assume a real wavefunction (that is always the case if the reference state is real)\n            reduces potential gradient costs from 4 to 2\n        Returns\n        -------\n            UpGCCSD ansatz\n        '
    name = name.upper()
    if (('A' in name) and (neglect_z is None)):
        neglect_z = True
    else:
        neglect_z = False
    if (order is None):
        try:
            if ('-' in name):
                order = int(name.split('-')[0])
            else:
                order = 1
        except:
            order = 1
    indices = self.make_upccgsd_indices(key=name)
    have_hcb_trafo = (self.transformation.hcb_to_me() is not None)
    if (have_hcb_trafo and (hcb_optimization is None)):
        hcb_optimization = True
    if ('HCB' in name):
        hcb_optimization = True
    if (hcb_optimization and (not have_hcb_trafo) and ('HCB' not in name)):
        raise TequilaException("use_hcb={} but transformation={} has no 'hcb_to_me' function. Try transformation='ReorderedJordanWigner'".format(hcb_optimization, self.transformation))
    if (('S' in name) and ('HCB' in name)):
        if (('HCB' in name) and ('S' in name)):
            raise Exception("name={}, Singles can't be realized without mapping back to the standard encoding leave S or HCB out of the name".format(name))
    if (not hcb_optimization):
        U = QCircuit()
        if include_reference:
            U = self.prepare_reference()
        U += self.make_upccgsd_layer(*args, include_singles=('S' in name), indices=indices, assume_real=assume_real, label=(label, 0), spin_adapt_singles=spin_adapt_singles, **kwargs)
    else:
        U = QCircuit()
        if include_reference:
            U = self.prepare_hardcore_boson_reference()
        U += self.make_hardcore_boson_upccgd_layer(*args, indices=indices, assume_real=assume_real, label=(label, 0), **kwargs)
        if ('HCB' not in name):
            U = self.hcb_to_me(U=U)
        if ('S' in name):
            U += self.make_upccgsd_singles(*args, indices=indices, assume_real=assume_real, label=(label, 0), spin_adapt_singles=spin_adapt_singles, neglect_z=neglect_z, **kwargs)
    for k in range(1, order):
        U += self.make_upccgsd_layer(include_singles=('S' in name), indices=indices, label=(label, k), spin_adapt_singles=spin_adapt_singles, neglect_z=neglect_z)
    return U