Re: Re: Problem Replacing part of NonCommutativeMultiply

• To: mathgroup at smc.vnet.net
• Subject: [mg104579] Re: [mg104514] Re: Problem Replacing part of NonCommutativeMultiply
• From: DrMajorBob <btreat1 at austin.rr.com>
• Date: Wed, 4 Nov 2009 01:36:23 -0500 (EST)
• References: <hcl3s1\$bvc\$1@smc.vnet.net> <200911030751.CAA01007@smc.vnet.net>

```Or, if you don't want to risk Unprotect:

g ** a ** p ** r ** e ** r ** e /.
NonCommutativeMultiply[___, r, e, r, e, ___] :> 0

0

Bobby

On Tue, 03 Nov 2009 01:51:17 -0600, magma <maderri2 at gmail.com> wrote:

> On Nov 1, 11:59 pm, Iv=E1n Lazaro <gamins... at gmail.com> wrote:
>> Dear all,
>>
>> I'm working with a huge amount (2000) of terms of this tipe:
>> g**a**p**r**e**r**e
>>
>> But a lot of them are cero. The problem is that i'm not able to set
>> r**e**r**e->0 in such expresions. If I do
>> g**a**p**r**e**r**e/.r**e**r**e->0
>> nothing happens.
>>
>> Do you have some idea?
>>
>> Thanks a lot!
>
> Try this:
>
> NonCommutativeMultiply // Unprotect
> NonCommutativeMultiply[x___, 0, y___] := 0
> g ** a ** p ** r ** e ** r ** e ** f ** h /. r ** e ** r ** e -> 0
>
> et voila'...you get 0
>

--
DrMajorBob at yahoo.com

```

• Prev by Date: Re: Re: Fit function vs Hand Calculation
• Next by Date: Re: Re: Wrong Simplify[] Answer for Simplify[Cos[x]^4-Sin[x]^4]?
• Previous by thread: Re: Problem Replacing part of NonCommutativeMultiply expresions
• Next by thread: Re: Problem Replacing part of NonCommutativeMultiply expresions