Julian Rüth
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- tags: sage-days-114 --- # Sage Club at CMI These are our records of to the Sage Club at CMI in Chennai, India in 2022. Anybody can edit these records, so please **plunge forward** and edit this document :+1: There's a related page in the SageMath wiki at https://wiki.sagemath.org/days114/club. # Generalities Samuel Lelièvre and [Julian Rüth](mailto:julian.rueth@fsfe.org) are visiting CMI from 28/7/2022 until 27/08/2022. If you want to discuss something (related to SageMath or not) please drop by their offices anytime, **FR-03** and **FR-05**, respectively. We scheduled Sage Club on **Mondays & Thursdays from 2pm-4pm in LH-6** at CMI. On Thursdays, we have the lecture hall also after 4pm, so we can extend the session easily. In any case, Sage Club is not limited to these times. We can arrange sessions at any other time or you can just drop by our offices. # Sessions Here's a rough record of the sessions we had and what's planned for the future. ## Thursday 25/8 -- Parallel Computations in SageMath There's a recording of much of the session at https://us02web.zoom.us/rec/share/dXuHoGKLWUG5KSiyQlWJYgUYDeo9DAEVs77x52lNYk3TaoyTOZO9wsLyXI9TP-j3.7UqenXb11_C_jPvt During the session we'll parallelize some code originally written by Krishna Menon, namely: ```python=3 class FencePolynomials: def __init__(self): from sage.all import QQ R = QQ["q", "t", "u"] self._q, self._t, self._u = R.gens() def _fence(self, composition): elements = list(range(1, composition.size() + 2)) relations = [] for i, a in enumerate(composition): s = sum(composition[:i], 1) if i % 2 == 0: for j in range(s, s + a): relations.append([j, j + 1]) else: for j in range(s, s + a): relations.append([j + 1, j]) from sage.all import Poset return Poset((elements, relations)) def _minimal_elements_of_complement(self, poset, ideal): count = 0 for p in poset: if p in ideal: continue for below in poset.lower_covers_iterator(p): if below not in ideal: break else: count += 1 return count def _polynomial(self, composition): poset = self._fence(composition) return sum( self._q ** len(ideal := poset.order_ideal(a)) * self._t ** len(a) * self._u ** self._minimal_elements_of_complement(poset, ideal) for a in poset.antichains() ) def _compositions_without_even_length_reverses(self, size): from sage.all import Compositions for c in Compositions(size): if len(c) % 2 or c < c.reversed(): yield c def check_collisions(self, size): polynomial_to_composition = {} compositions = self._compositions_without_even_length_reverses(size) from rich.progress import track for composition in track(compositions): polynomial = self._polynomial(composition) if polynomial in polynomial_to_composition: raise Exception( f"Found collision for polynomial {polynomial} corresponding to both {polynomial_to_composition[polynomial]} and {composition}" ) polynomial_to_composition[polynomial] = composition ``` ## Wednesday 24/8 Samuel and Julian at IMSc for informal Sage Club. - finish up ticket 34373 on multimajor index for permutations ### Bug in coinversions of nonattacking fillings ``` sage: fill = [[4, 3], [2], [], [2]] sage: perm = PermutationGroupElement([4, 2, 1, 3]) sage: f = AugmentedLatticeDiagramFilling(fill, perm) sage: f [[4, 4, 3], [2, 2], [1], [3, 2]] ``` ## Tuesday 23/8 -- IMSc Samuel and Julian at IMSc for informal Sage Club. ### Lie algebras Aritra is interested in the paper - Pamela E. Harris, Erik Insko, Anthony Simpson. Computing weight q-multiplicities for the representations of the simple Lie algebras https://arxiv.org/abs/1710.02183 links to a code repository hosted at - https://github.com/antman1935/lie_algebras We clone that repository: ```bash $ git clone https://github.com/antman1935/lie_algebras.git ``` We change to the resulting directory: ```bash $ cd lie_algebras ``` We run the Python file: ```bash $ sage --python lie_algebra_multiplicity.py 6006 ``` ### Multimajor index for permutations We resume last week's work on implementing multimajor index for permutations. https://trac.sagemath.org/ticket/34373 To get the branch from the ticket: ```bash $ git fetch trac u/gh-25shriya/34373 $ git switch -c t-34373 FETCH_HEAD ``` ## Monday 22/8 -- Debugging SageMath We want to look at bugs in SageMath. Please suggest things that don't work right. We want to find out how to report things properly, and how to find out what is causing a problem. ## Thursday 18/8 -- Implement new Structures in SageMath We will walk you through implementing a new mathematical object in SageMath. Please bring your laptops to follow along. We will try to implement [Plactic Monoids](https://en.wikipedia.org/wiki/Plactic_monoid) since they don't seem to be present in SageMath yet. The code we wrote is at https://gist.github.com/saraedum/7c88d7735edb124fba730116b62a76e8 A good tutorial is also at https://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html#coercion-and-categories ## Wednesday 17/8 -- IMSc Samuel and Julian at IMSc for informal Sage Club. - more installation steps on WSL - work on multimajor index for permutations ## Tuesday 16/8 -- IMSc Samuel and Julian at IMSc for informal Sage Club. - install Sage on Windows using WSL and Conda - released version - latest version for development - work on multimajor index for permutations ## Monday, 15/8 -- No Sage Club -- Enjoy the Holiday! ## Thursday, 11/8 -- Version Control with Git We'll do a [Software Carpentry](https://software-carpentry.org/) style [Introduction to Git](https://swcarpentry.github.io/git-novice/). Please bring your laptops. Please make sure that you have the Bash shell and Git installed. Instructions for Linux, macOS, and Windows can be found here: - [Installing Bash](https://carpentries.github.io/workshop-template/#shell) - [Installing Git](https://carpentries.github.io/workshop-template/#git) ## Monday, 8/8 -- Parametric curves in Sage We will see how to use Sage to study and plot a parametric curve. This will use Sage's symbolic ring. ## Thursday, 4/8 -- An Introduction to SageMath We'll probably do another introduction to SageMath & install session for students that were not here during SageDays at IMSc. ### Installing SageMath We walked some people through installing SageMath, see https://doc.sagemath.org/html/en/installation/index.html. ### Finding Duplicates We looked at the problem of finding duplicates in a recursive generating function. Here's the code we ended up with: ```python= q = var('q') def f(A): if len(A) == 1: return 1 + q^A[0] return q^A[-1] * f(A[:-1]) from collections import defaultdict D = defaultdict(lambda: set()) for length in range(1, 5): for c in cartesian_product([range(1, 6)] * length): value = f(c) D[value].add(c) for value in D: if len(D[value]) > 1: print(D[value], value) ``` ### Computations with Power Series ```python= R.<x, y> = QQ[[]] g = (1 + x).log(prec=123) * (1 + y).log(3) ``` ## Monday, 1/8 -- Python Best Practices We'll use a package called [stallings_graphs](https://plmlab.math.cnrs.fr/pascalweil/stallings_graphs/) ```bash sage -pip install stallings_graphs ``` ### Know your Editor e.g., shortcuts to (un)indent, set a shortcut to restart & run all in the notebook ### Writing Good Code Show your code to others and import this ### Code Formatting black directory/ ### Linters Instally any/all of pylint, pyright, pylance[^1], … and teach your editor to actually use them. ### Optimizing Code > We should forget about small efficiencies, say about 97% of the time: > premature optimization is the root of all evil. > -- [Tony Hoare](https://en.wikipedia.org/wiki/Tony_Hoare) Running `py-spy record --format=speedscope -- sage something.sage` often fails. Preprocess with `sage --preprocess something.sage`, then `py-spy record --format=speedscope -- python something.sage.py`. Open the output in [speedscope.app](https://speedscope.app). You can also see native C/C++/… calls with `--native` but you might want to lower the sampling rate to, 10Hz or so (check the other command line flags…) We lookd at SageMath's `@cached_function` and `@cached_method`. There's also a builtin LRU cache in Python. ## Thursday, 28/7 -- An Introduction to SageMath A tour of SageMath, [where is the notebook?](); we collected ideas about future sessions, namely ### Topics for Sage Club * SageMath Development Process * Commutative Algebra in SageMath, in particular interfacing with Singular * Combinatoris in SageMath, in particular 4ti2 and Widgets to interact with partially ordered sets (posets) * Best Practices of Python Programming * Findstat * Writing Python/SageMath Packages / How to Share your Code / Zenodo * Introduction to Git Please add more topics, and let us know about other things you would like to discuss :+1: [^1]: pylance is not free (as in freedom) software; also, it does not currently understand imports from `sage`.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully