This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Partially inspired from https://stackoverflow.com/a/70686229 | |
""" | |
import torch as pt | |
def lowtr_circulant(diag: pt.Tensor, dim: int=-1): | |
r""" | |
From a vector ``diag``, computes its flipped circular embedding with zeros | |
above the diagonal. | |
Can be batched in left dimension(s). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A Typst block quote that looks like a `>` syntax sugar in markdown (e.g. github renderer). | |
// Put on top of relevant files. | |
#show quote.where(block: true): content => block( | |
fill: luma(245), | |
inset: (left: 3%, y: 10%), | |
radius: (right: 5pt), | |
stroke: (left: 1pt+luma(100)), | |
content | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#let theoremblock(title: [Theorem:], color: green, radius: (top-right: 2pt, bottom-right: 2pt), ..args, body) = { | |
// The top-title block needs only the | |
let tr = radius.at( | |
default: radius.at( | |
default: radius.at( | |
default: 0pt, | |
"right" | |
), | |
"top" | |
), |