Ask Your Question
0

Getting Dyck path pictures from Dyck words

asked 2023-04-26 14:00:43 +0100

klaaa gravatar image

updated 2023-04-26 14:50:29 +0100

Max Alekseyev gravatar image

I have a list of Dyck words in sage that correspond to Dyck paths, for example:

L=[[1, 0, 1, 0, 1, 1, 0, 1, 0, 0], [1, 0, 1, 1, 0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 0, 1, 1, 0, 1, 0, 0], [1, 1, 0, 1, 0, 0, 1, 0, 1, 0], [1, 1, 0, 1, 0, 0, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0, 0, 1, 0], [1, 1, 0, 1, 0, 1, 1, 0, 0, 0], [1, 1, 0, 1, 1, 0, 0, 0, 1, 0], [1, 1, 0, 1, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 1, 0, 1, 0, 0], [1, 1, 1, 1, 0, 0, 0, 1, 0, 0], [1, 1, 1, 1, 0, 1, 0, 0, 0, 0]]

My question is how can I tell sage to print the Dyck paths as a picture for each of those Dyck words in a readable fashion that might help me to find patterns in such a list of Dyck words. Thanks for any help.

edit retag flag offensive close merge delete

Comments

2

Use %display unicode_art or unicode_art([DyckWord(w) for w in L])

FrédéricC gravatar imageFrédéricC ( 2023-04-26 16:10:49 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2023-04-26 14:54:42 +0100

Max Alekseyev gravatar image

Try this:

for p in L:
    print(DyckWord(p).to_path_string())
    print('-'*len(p))
edit flag offensive delete link more

Comments

Thanks. Is there a nicer way to get the output like the output one has for posets in sage which looks like a latex output?

klaaa gravatar imageklaaa ( 2023-04-26 20:07:35 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-04-26 14:00:43 +0100

Seen: 149 times

Last updated: Apr 26 '23