Opened 6 years ago

Closed 5 years ago

#17035 closed enhancement (fixed)

Add an option for indexed generators to display strings without quotes

Reported by: tscrim Owned by: sage-combinat
Priority: major Milestone: sage-6.10
Component: misc Keywords:
Cc: sage-combinat, nthiery Merged in:
Authors: Travis Scrimshaw Reviewers: Darij Grinberg
Report Upstream: N/A Work issues:
Branch: 5b546c2 (Commits) Commit: 5b546c2b28c52e72785c5e52016321804e249b6b
Dependencies: Stopgaps:

Description

In order to do have the generators print like other variables in Sage. So we'd have the following:

sage: C = CombinatorialFreeModule(QQ, ['x','y','z'], prefix='', bracket=False, string_quotes=False)
sage: C.an_element()
2*x + 2*y + 3*z

Thus it matches polynomial rings and other variables in Sage and gives a cleaner output.

Change History (11)

comment:1 Changed 6 years ago by tscrim

  • Branch set to public/misc/quote_option_indexed_generators-17035
  • Commit set to 5b546c2b28c52e72785c5e52016321804e249b6b
  • Status changed from new to needs_review

New commits:

f94c3f8Another optio for indexed generators.
5b546c2Fixed failing doctest.

comment:2 follow-up: Changed 6 years ago by nbruin

Shouldn't

sage: M.<a,b,c>=CombinatorialFreeModule(QQ)

work too?

comment:3 Changed 6 years ago by nthiery

+1 on the feature, thanks! I am not super convinced by the option name, but did not manage to come up with something better. Ideas anyone?

comment:4 in reply to: ↑ 2 Changed 6 years ago by nthiery

Replying to nbruin:

Shouldn't

sage: M.<a,b,c>=CombinatorialFreeModule(QQ)

work too?

This definitely would make sense! Given this is not directly related, this can go in a separate ticket at Travis's convenience.

comment:5 Changed 6 years ago by tscrim

For the most part, it's handling a names argument and I'm currently doing this at the level of the Lie algebra in #14901 (similar for indexed free monoid/group). However this probably is best (and more uniform) to do this in IndexedGenerators. This is now #17039, which I will do later today.

comment:6 Changed 6 years ago by tscrim

  • Milestone changed from sage-6.4 to sage-6.8

comment:7 Changed 5 years ago by darij

  • Status changed from needs_review to positive_review

comment:8 Changed 5 years ago by darij

LGTM!

comment:9 Changed 5 years ago by vbraun

  • Status changed from positive_review to needs_work

Reviewer nam

comment:10 Changed 5 years ago by darij

  • Milestone changed from sage-6.8 to sage-6.10
  • Reviewers set to Darij Grinberg
  • Status changed from needs_work to positive_review

comment:11 Changed 5 years ago by vbraun

  • Branch changed from public/misc/quote_option_indexed_generators-17035 to 5b546c2b28c52e72785c5e52016321804e249b6b
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.