|   | 1 |  initial version  | 
Indeed, (pp*A*qq).collect(p) does not work because p now refers to the tuple containing the indexed variables, rather than the original p. So, use a different name for the tuple of indexed variables, like P:
P = var("p", n=10, latex_name='\\overline{p}')
EGe0 = (pp*A*qq).collect(p).subs(p==P[0])
show(EGe0)
Output: $${\left(2 q x + {\left(q - 1\right)} y\right)} {\overline{p}}_{0} - q x$$
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.