@property
def stabs_destabs(self):
    if self._stabs_destabs:
        return self._stabs_destabs
    if (self.qecc.height != self.qecc.width):
        raise Exception('This currently only works for square code blocks.')
    instr = self
    stabs_row_x = []
    stabs_row_z = []
    destabs_row_x = []
    destabs_row_z = []
    for a in self.ancilla_qudit_set:
        stabs_row_z.append({a})
        stabs_row_x.append(set([]))
        destabs_row_x.append({a})
        destabs_row_z.append(set([]))
    xdestabs = self.generate_xdestabs()
    zdestabs = self.generate_zdestabs()
    for (check_type, _, params) in instr.abstract_circuit.items():
        if (check_type == 'X check'):
            stabs_row_x.append(set(params['datas']))
            stabs_row_z.append(set([]))
            destabs_row_x.append(set([]))
            destabs_row_z.append(zdestabs[params['ancillas']])
        else:
            stabs_row_z.append(set(params['datas']))
            stabs_row_x.append(set([]))
            destabs_row_z.append(set([]))
            destabs_row_x.append(xdestabs[params['ancillas']])
    output_dict = {'stabs_x': stabs_row_x, 'stabs_z': stabs_row_z, 'destabs_x': destabs_row_x, 'destabs_z': destabs_row_z}
    self._stabs_destabs = output_dict
    return output_dict
@property
def stabs_destabs(self):
    if self._stabs_destabs:
        return self._stabs_destabs
    if (self.qecc.height != self.qecc.width):
        raise Exception('This currently only works for square code blocks.')
    instr = self
    stabs_row_x = []
    stabs_row_z = []
    destabs_row_x = []
    destabs_row_z = []
    for a in self.ancilla_qudit_set:
        stabs_row_z.append({a})
        stabs_row_x.append(set([]))
        destabs_row_x.append({a})
        destabs_row_z.append(set([]))
    xdestabs = self.generate_xdestabs()
    zdestabs = self.generate_zdestabs()
    for (check_type, _, params) in instr.abstract_circuit.items():
        if (check_type == 'X check'):
            stabs_row_x.append(set(params['datas']))
            stabs_row_z.append(set([]))
            destabs_row_x.append(set([]))
            destabs_row_z.append(zdestabs[params['ancillas']])
        else:
            stabs_row_z.append(set(params['datas']))
            stabs_row_x.append(set([]))
            destabs_row_z.append(set([]))
            destabs_row_x.append(xdestabs[params['ancillas']])
    output_dict = {'stabs_x': stabs_row_x, 'stabs_z': stabs_row_z, 'destabs_x': destabs_row_x, 'destabs_z': destabs_row_z}
    self._stabs_destabs = output_dict
    return output_dict