Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rational exponent for finite words #12226

Open
staroste opened this issue Dec 23, 2011 · 4 comments
Open

rational exponent for finite words #12226

staroste opened this issue Dec 23, 2011 · 4 comments

Comments

@staroste
Copy link

Upgrade exponent of a FiniteWord_class to calculate rational exponents.

Now:

sage: Word('1231').exponent()
1

Expected:

sage: Word('1231').exponent()
4/3

The goal

sage: Word('1231').exponent()
4/3
sage: Word('1231').exponent(integer=True)
1

Also, upgrade (deprecate, review, and/or change name) the method primitive() to be in accordance with the terminology used in literature (the word is usually called the period instead of the primitive)

sage: Word('1231').exponent()
4/3
sage: Word('1231').period()
word: 123

Upgrade influenced methods (primitive_length(), ...).

CC: @videlec @seblabbe

Component: combinatorics

Issue created by migration from https://trac.sagemath.org/ticket/12226

@staroste staroste added this to the sage-5.11 milestone Dec 23, 2011
@staroste staroste changed the title rational a finite word rational exponent for finite words Dec 23, 2011
@seblabbe
Copy link
Contributor

seblabbe commented Jan 9, 2012

comment:2

Should not period be an integer?

... I already had the idea of making period an alias of minimal_period:

sage: Word('1231').minimal_period()
3

What do you think?

@staroste
Copy link
Author

staroste commented Jan 9, 2012

comment:3

Replying to @seblabbe:

Should not period be an integer?

You are right, I found both versions in the literature (integer in Lothaire, word for instance in http://www.springerlink.com/content/t59071u33573168v/ )

When hearing period without context, I think an integer is expected. Although a word is definitely more useful in papers and you have the integer by taking just the length of the word.

Is something like that stupid?

sage: Word('1231').period(word=True)
word: 123
sage: Word('1231').period()
3

What do you think?

I think an alias is not necessary. There is no other period, and anyone looking for that notion will use "period" anyway.

@seblabbe
Copy link
Contributor

comment:4

I think an alias is not necessary. There is no other period, and anyone looking for that notion will use "period" anyway.

If 3 is a period, than 6, 9, 12 are period as well. But I agree that 3 is the period.

I would rather suggest the following :

sage: Word('1231').period_word()
word: 123
sage: Word('1231').period()
3

@seblabbe
Copy link
Contributor

The goal

sage: Word('1231').exponent()
4/3
sage: Word('1231').exponent(integer=True)
1

I would prefer the argument to speak about the use or not of the fraction :

sage: Word('1231').exponent() # default
1
sage: Word('1231').exponent(allow_fraction=True)
4/3

or

sage: Word('1231').exponent(allow_fraction=False)
1
sage: Word('1231').exponent() # default
4/3

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants