Ask Your Question

Peter Heinig's profile - activity

2023-12-24 17:18:36 +0200 received badge  Notable Question (source)
2023-12-24 17:18:36 +0200 received badge  Popular Question (source)
2022-11-09 01:50:41 +0200 received badge  Famous Question (source)
2022-11-09 01:50:41 +0200 received badge  Notable Question (source)
2022-01-30 21:04:44 +0200 received badge  Famous Question (source)
2020-07-28 23:36:00 +0200 received badge  Notable Question (source)
2019-08-26 21:13:03 +0200 received badge  Popular Question (source)
2019-06-05 00:34:24 +0200 received badge  Popular Question (source)
2018-03-26 14:14:00 +0200 received badge  Nice Question (source)
2018-03-23 19:07:01 +0200 asked a question How to test with whether a group is cyclic?

Does Sage offer a 'native' way to test whether a group is cyclic?

Remarks. Needless to say, Sage offers commands like 'is_abelian()' or 'is_finite()', but wherever I look, nothing like 'is_cyclic'.

2018-03-15 18:21:39 +0200 asked a question Why does this program sometimes cause an error message, while sometimes it runs perfectly?

I simply do not understand why the program

p0=[(ZZ.random_element(1,10),ZZ.random_element(1,10),ZZ.random_element(1,10))]

p1=[(ZZ.random_element(1,10),ZZ.random_element(1,10)),(ZZ.random_element(1,10),ZZ.random_element(1,10))]

print(p0)

print(p1)

G = PermutationGroup([p0,p1]).cayley_graph(connecting_set=[p0,p1]).to_simple()

A=G.adjacency_matrix()

A

seems to work perfectly about half of the time (I did not measure the success-probability precisely), but every other time yields the error message

Traceback (click to the left of this block for traceback)

...

ValueError: An element appears twice. It should not.

Question. What did I do wrong?

Again, often, I do not encounter any error. I recognize that I use random numbers as input, and the obvious guess is that this a contributing cause of the error, but, still, to me it seems that this should run each and every time.

2018-03-09 16:50:57 +0200 asked a question Is it possible to send a saved list of data to the sagecell-server

Is it possible to send a precomputed list L that one has computed and saved with

save(L,'filename')

to the server at https://sagecell.sagemath.org/ and then do a calculation with L on that server? If so, how?

2018-03-08 15:11:16 +0200 received badge  Supporter (source)
2018-03-08 11:21:30 +0200 received badge  Student (source)
2018-03-08 09:27:10 +0200 asked a question How to take an initial segment of the data structure graphs(n) ?

Is there a possibility to access individual elements of the data-structure constructed by the command

graphs(7)

? How to take an initial segment of it?

It seems not to be a list, which presumably is the reason why commands like ' graphs(7)[0] ' or ' graphs(7)[:5] ' are not allowed.

2018-03-07 19:26:15 +0200 received badge  Scholar (source)
2018-03-07 14:41:16 +0200 asked a question What is a possibility to tell Sage to turn a list into a multiset?

A well-known computer algebra package features a useful command called 'Tally', which e.g. takes a list like 2,1,2,2,3,1 and returns the list of pairs (1,2),(2,3),(3,1), where the second component of each pair equals the multiplicity of the first component of the pair in the input list. Currently, I am learning more Sage, and I need some functionality like the above.

My question. Is there a 'native' way to do the same in Sage? Of course, I could program something like this, but what is, in your opinion, the currently 'best' way to turn an arbitrary list into a multiset, with the multiplicities conveniently recorded?