CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual use to large groups and classes! Also, H100 GPUs starting at $2/hour.
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual use to large groups and classes! Also, H100 GPUs starting at $2/hour.
| Download
Project: Combinatorics classes 2024
Views: 8Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2204Posets in Sage - An Introduction
Math 737 - Lab 1
First define a poset.
Make a list of the elements of your poset, then a list of the covering relations between poset element.
Evaluate the cell below by putting your cursor in the block and then pressing shift + enter
You can also make a random poset.
Evaluate the cell below multiple times to see multiple random posets of 7 elements.
Exercise 1: Make some of the example posets P, Q, R, S, T, N, from our last class. We already made Q above.
Let's see what Sage can do with a poset.
Type the name of your poset, then type . and shift+enter. Scroll through the commands until you find one you recognize. Run a command; you likely need to add () at the end to make it work.
To access the documentation for a function, type the function with no () and put ? to see the documentation, and ?? to see the documentation and code
Exercise 2: Use Sage to verify your answers from yesterday's class. You may need to access the documentation to see what the function is actually doing.
The following function is code for the rank generating function of a poset P. It will not work if your poset does not have a rank function.
An order ideal is a subset of poset elements that is closed downward.
Let's make a random order ideal, using the code below. The green elements are the order ideal. The red elements are an order filter.
Error in lines 1-1
Traceback (most recent call last):
File "/cocalc/lib/python3.11/site-packages/smc_sagews/sage_server.py", line 1244, in execute
exec(
File "", line 1, in <module>
NameError: name 'P' is not defined