def disassociation(self, idx, *, field=None, **defaults_config): ''' Given vector operands, or all CartExp operands, deduce that this expression is equal to a form in which operand at index idx is no longer grouped together. For example, calling (a ⊗ b ⊗ ... (l ⊗ ... ⊗ m) ... ⊗ y ⊗ z).association(l-1) would return |- (a ⊗ b ⊗ ... (l ⊗ ... ⊗ m) ... ⊗ y ⊗ z) = (a ⊗ b ⊗ ... ⊗ l ⊗ ... ⊗ m ⊗ ... ⊗ y ⊗ z) Or calling (R3 ⊗ (R3 ⊗ R3)).disassociate(1) would return |- (R3 ⊗ (R3 ⊗ R3)) = (R3 ⊗ R3 ⊗ R3) For this to work in the vectors case, the vector operands must be known to be in vector spaces of a common field. If the field is not specified, then VecSpaces.default_field is used. For this to work in the case of CartExp operands, all operands must be (recursively) CartExps and each must be known to be a vector space. ''' # ORIGINAL BELOW before augmenting for CartExp cases # from . import tensor_prod_disassociation # _V = VecSpaces.known_vec_space(self, field=field) # _K = VecSpaces.known_field(_V) # eq = apply_disassociation_thm( # self, idx, tensor_prod_disassociation, # repl_map_extras={K:_K, V:_V}).derive_consequent() # return eq.with_wrapping_at() if not TensorProd.all_ops_are_cart_exp(self): from . import tensor_prod_disassociation _V = VecSpaces.known_vec_space(self, field=field) _K = VecSpaces.known_field(_V) eq = apply_disassociation_thm( self, idx, tensor_prod_disassociation, repl_map_extras={K:_K, V:_V}).derive_consequent() return eq.with_wrapping_at() else: from . import tensor_prod_vec_space_disassociation if field is None: _K = VecSpaces.known_field(self.operands[0]) else: _K = field eq = apply_disassociation_thm( self, idx, tensor_prod_vec_space_disassociation, repl_map_extras={K:_K}) return eq.with_wrapping_at()
def disassociation(self, idx, assumptions=USE_DEFAULTS): ''' Given Boolean operands, deduce that this expression is equal to a form in which the operand at index idx is no longer grouped together. For example, (A and B ... and (L and ... and M) and ... and Y and Z) = (A and B and ... and Y and Z) ''' from . import disassociation return apply_disassociation_thm(self, idx, disassociation, assumptions)
def disassociation(self, idx, assumptions=USE_DEFAULTS): ''' Given numerical operands, deduce that this expression is equal to a form in which the operand at index idx is no longer grouped together. For example, (a + b ... + (l + ... + m) + ... + y+ z) = (a + b + ... + y + z) ''' from ._theorems_ import disassociation return apply_disassociation_thm(self, idx, disassociation, assumptions)
def disassociation(self, idx, assumptions=USE_DEFAULTS): ''' Given Boolean operands, deduce that this expression is equal to a form in which the operand at index idx is no longer grouped together. For example, (A or B ... or (L or ... or M) or ... or Y or Z) = (A or B or ... or Y or Z) ''' from ._theorems_ import disassociation return apply_disassociation_thm(self, idx, disassociation, assumptions)
def disassociate(self, idx, assumptions=USE_DEFAULTS): ''' From self, derive and return a form in which the operand at the given index is ungrouped. For example, from (A and B ... and (L and ... and M) and ... and Y and Z) derive (A and B and ... and Y and Z). ''' from . import disassociate return apply_disassociation_thm(self, idx, disassociate, assumptions)
def disassociate(self, idx, assumptions=USE_DEFAULTS): ''' From self, derive and return a form in which the operand at the given index is ungrouped. For example, from (A or B ... or (L or ... or M) or ... or Y or Z) derive (A or B or ... or Y or Z). ''' from . import disassociate return apply_disassociation_thm(self, idx, disassociate, assumptions)
def disassociate(self, idx, **defaults_config): ''' From self, derive and return a form in which the operand at the given index is ungrouped. For example, from (A or B ... or (L or ... or M) or ... or Y or Z) derive (A or B or ... or Y or Z). ''' from . import disassociate return apply_disassociation_thm(self, idx, disassociate)
def disassociate(self, idx, **defaults_config): ''' From self, derive and return a form in which the operand at the given index is ungrouped. For example, from (A and B ... and (L and ... and M) and ... and Y and Z) derive (A and B and ... and Y and Z). ''' from . import disassociate return apply_disassociation_thm(self, idx, disassociate)
def disassociation(self, idx, **defaults_config): ''' Given Boolean operands, deduce that this expression is equal to a form in which the operand at index idx is no longer grouped together. For example, (A or B ... or (L or ... or M) or ... or Y or Z) = (A or B or ... or Y or Z) ''' from . import disassociation return apply_disassociation_thm(self, idx, disassociation)
def disassociation(self, idx, **defaults_config): ''' Given a valid Qmult operation (valid sequence of bras, kets, and/or quantum operations), deduce that this expression is equal to a form in which the operand at index idx is no longer grouped together. For example, (A B ... (L ... M) ... Y Z) = (A B ... Y Z). ''' from . import qmult_disassociation eq = apply_disassociation_thm(self, idx, qmult_disassociation) return eq.with_wrapping_at()