Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
0

Getting Dyck path pictures from Dyck words

asked 1 year ago

klaaa gravatar image

updated 1 year ago

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.

Preview: (hide)

Comments

2

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

FrédéricC gravatar imageFrédéricC ( 1 year ago )

1 Answer

Sort by » oldest newest most voted
1

answered 1 year ago

Max Alekseyev gravatar image

Try this:

for p in L:
    print(DyckWord(p).to_path_string())
    print('-'*len(p))
Preview: (hide)
link

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 ( 1 year ago )

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: 1 year ago

Seen: 178 times

Last updated: Apr 26 '23