#!/usr/bin/env python3 """Exact field equations of the compressed reference chart (Q(sqrt(2))).""" from fractions import Fraction as Q from pathlib import Path import importlib.util _spec=importlib.util.spec_from_file_location('abc81_sparse',Path(__file__).resolve().parent.parent/'abc81_v25/build.py') _mod=importlib.util.module_from_spec(_spec);_spec.loader.exec_module(_mod) kconst,plus,times,power2=(_mod.kconst,_mod.plus,_mod.times,_mod.power2) def equations(f,S,B,w,T): k=lambda a,b=0:kconst(Q(a),Q(b)) Q1=plus(times(S,T),times(k('26325600/4905889','-13327692/4905889'),times(f,T)), times(k('279649719/201141449','-615250593/804565796'),T), times(k('-87/41','129/164'),S),times(k('76828374/4905889','-48988044/4905889'),f), k('21373536/4905889','-4638784/4905889')) Q3=plus(times(B,T),times(k('310419/658952','-15327/329476'),times(f,T)), times(k('-667923/658952','-72481/329476'),times(f,S)), times(k('87/41','-129/164'),B),times(k('-11/49','-6/49'),T),k('570/2009','669/8036')) M=plus(B,times(k('23335979380411305/9142573010269636','-256685364214285/4571286505134818'),f), times(k('44649296511110307/111996519375803041','-2886885451827729/447986077503212164'),S), k('3317607896141091533/7167777240051394624','677690583653850567/1791944310012848656')) L=plus(k('-287384773949078688806717371/430762914076126579926624016','-81557625814705269604141077/215381457038063289963312008'), times(k('1256455567493584412665635/2197769969776156020033796','214486582192171922617190/549442492444039005008449'),f), times(k('-4766844858863040/111996519375803041','-3149175549566448/111996519375803041'),S), times(k('9191218419936655190467815/26922682129757911245414001','47475418018975282967719917/215381457038063289963312008'),T), times(k('-86993/153664','-4947/38416'),B), times(k('171357/235298','2519877/7529536'),times(f,S)), times(k('-47892880950890591270656509/53845364259515822490828002','-647265901015780366495244709/1723051656304506319706496064'),times(f,T))) return Q1,plus(times(M,w),L),Q3,M,L