Skip to content

Instantly share code, notes, and snippets.

View maresb's full-sized avatar

Ben Mares maresb

  • Tensorial (EI Bernard Mares)
  • Ferney-Voltaire, France
View GitHub Profile
### Keybase proof
I hereby claim:
* I am maresb on github.
* I am maresb (https://keybase.io/maresb) on keybase.
* I have a public key ASA8DYv0J6fm3Bi7xz9WsJQyyYXhkOWM18rNTCEl72au-Ao
To claim this, I am signing this object:
# These are the vectors in Schiemann's S2 lattice of length <= sqrt(8).
# This is (loosely) a Protein Data Bank format file.
# <https://en.wikipedia.org/wiki/Protein_Data_Bank_(file_format)>
# I tried to find an embedding with rational coordinates, but I don't think
# it's possible. Here I use (1 + sqrt(61)) / 4 = 2.2026 and
# (1 - sqrt(61)) / 4 = -1.7026.
# These are the vectors in Schiemann's S1 lattice of length <= sqrt(8).
# This is (loosely) a Protein Data Bank format file.
# <https://en.wikipedia.org/wiki/Protein_Data_Bank_(file_format)>
# I tried to find an embedding with rational coordinates, but I don't think
# it's possible. Here I use sqrt(7) = 2.6458.
# To verify correctness, note that the Gram matrix can be generated in PARI/GP
@maresb
maresb / schiemann.gp
Last active October 6, 2023 21:16
Exploring Schiemann's pair with PARI/GP
/*
An exploration of Alexander Schiemann's pair of inequivalent 4D lattices with
identical theta functions.
Context: <https://math.stackexchange.com/questions/4428707>
Ben Mares, 2022
from typing import Dict, List, Union
from sqlalchemy import Column
from sqlalchemy.orm import (
ColumnProperty,
InstrumentedAttribute,
MapperProperty,
RelationshipProperty,
)
from sqlmodel.main import SQLModelMetaclass
@maresb
maresb / managed_temporary_credentials_provider.py
Last active July 16, 2024 13:01
Make boto3 automatically check the shared credentials file for updates.
"""Make boto3 automatically check the shared credentials file for updates.
In some situations, the ~/.aws/credentials file may be periodically updated. For
example, this is the case with the "AWS managed temporary credentials" which are
provided to AWS Cloud9 environments. (See
<https://docs.aws.amazon.com/cloud9/latest/user-guide/how-cloud9-with-iam.html#auth-and-access-control-temporary-managed-credentials>.)
Example usage of this module is:
import boto3