ngraymon / termfactory Goto Github PK
View Code? Open in Web Editor NEWExploring a formal representation for the residual terms and/or cleaning up code of the residual equation generator
License: MIT License
Exploring a formal representation for the residual terms and/or cleaning up code of the residual equation generator
License: MIT License
We can have a different name on pypi than the actual package name
so working title for now is residual_term_builder
then on pypi it could be called resid-build
so you could
pip install resid-build
see
https://stackoverflow.com/questions/52827722/folder-naming-convention-for-python-projects
In GitLab by @ngraymon on Apr 28, 2021, 12:50
Rather then having them be a list of numbers orindividual keywords (which makes the function definitions super crazy long and unreadable) lets just have all of these 'master/parent' functions take an argument truncation
which should always be a dictionary. Also add in simple checks for each function to make sure the expected keys are present and that the numbers provided are in an acceptable range (0 < N < max_number
is probably fine for all of them, define the maximums at the top of the file)
Also we probably want the dictionary keys to be expanded in full so as to not confuse them with the variables used in the functions.
Meaning
maximum_h_rank
becomes maximum_hamiltonian_rank
maximum_cc_rank
becomes maximum_coupled_cluster_rank
so like just below here
truncation_maximums = {
maximum_h_rank: 6,
maximum_cc_rank: 6,
s_taylor_max_order: 6,
omega_max_order: 6,
max_residual_order: 8,
max_w_order: 8,
dt_order: 8,
}
and then around line 3265 (cut out the red lines)
for key in ["maximum_h_rank", "maximum_cc_rank", "s_taylor_max_order", "omega_max_order"]:
assert key in truncations, f"Missing key {key = :s} in provided dictionary {truncations=:}"
assert truncations[key] <= truncation_maximums[key], f"Key {key = :s} is over the maximum of {truncation_maximums[key] = :}"
maximum_h_rank = truncations["maximum_h_rank"]
maximum_cc_rank = truncations["maximum_cc_rank "]
s_taylor_max_order = truncations["s_taylor_max_order "]
omega_max_order = truncations["omega_max_order "]
how much dependency between tasks is ther
A few links listing how other people have approached this issue:
Honestly it might be worth it to just simply make a new private repo and experiment with pushing there and we can always delete the repo
In GitLab by @lhprice on Sep 7, 2021, 13:32
Merges lhprice-master-patch-17821 -> master
probably for the eT ZHZ part as that doesn't have a working excited state code a.t.
we should find out where?!
Things like _make_h_z_default_dict
and _verify_connected
and _verify_keys
etc.
We should add argparse
to better take user input.
Should also designate an output folder to save the .tex files and .pdf files to.
This could be something modified by the user input through argparse
.
Mostly this is because I realized the directory was getting crowded
We don't have to but I thought I'd throw the files up here in case you wanted to try and run them.
@bsonghao
instead of
py -m coverage run generate_residual_equations.py
we want to run
py -m coverage run code_cov.py
which basically is just a fancy wrapper around generate_residual_equations.py
which loops over all possible permutations (ground state versus not ground state...etc) of the execution of the main functions:
generate_latex_files
generate_python_files
Also, this would check what functions are not used at all right now.
In this way we don't need to change the module generate_residual_equations.py
to fit testing/code cov details
rather all of that business can be relegated to code_cov.py
Is standard practice to have a branch off the main branch which has all the testing files etc?
Or what?
Asked my friend what online services he uses and he recommended lightsail I'm willing to pony 5$ a month if you can figure out how to setup a runner on one of their virtual servers. It seems at the moment we'd get 3 months free too. Then we can link the deployment to the server and you don't have to run directly off your machine.
Trying to make gitlab-ci.yaml work on windows and/or inside unix
looked at the following links:
eventually we gave up on trying to use all the solutions and just had lucas install WSL2 and run the gitlab runner inside docker on wsl2
In GitLab by @ngraymon on Apr 28, 2021, 12:51
In GitLab by @lhprice on Sep 7, 2021, 13:48
maybe try this? https://stackoverflow.com/questions/59203694/javascript-html-in-gitlab-wiki-page and put the pycoverage html into the wiki?
See this link for logging numbers
maybe we want to define our own custom logging numbers??
i know i probably log more than necessary but it is good to have the option for extreme output when debugging sometime. For example being able to do something like:
if loop_index == 43:
log.setLevel(0)
else:
log.setLevel('ERROR')
That way we don't have to push to master when testing the badge changes?
And we only need a single commit to fix the master badge hopefully.
Adding testing to the following modules:
and these modules are not being covered/tested:
In GitLab by @lhprice on Nov 3, 2021, 19:17
reminder for me to check if pytest is baked into the docker image
terms such as
dz_i -= 0.5 * X * np.einsum('k,l,ykli->yi', T_conj[1], T_conj[1], Z[3])
dz_i -= 0.5 * np.einsum('k,l,ykli->yi', T_conj[1], T_conj[1], dz_3)
where
X = np.einsum('k,k->', T_conj[1], dT[1])
X2 = np.einsum('k,j,kj->', T_conj[1], T_conj[1], dT[1])
although maybe X2 doesn't even make sense?
so maybe just abandon this whole thing
In GitLab by @ngraymon on Apr 20, 2022, 18:43
Might have to bring code over from the remove_prints branch?
writing a setup.cfg, all that other stuff
probably a good experience for @lhprice and he can look at Pibronic as an example
this is the stuff that makes pip install resid-build
work!
For testing purposes you can do pip install -e resid-build
Merges adding_main_file_compares -> master
added main function tests
Update .gitignore
to not track .tex
and .pdf
files in the tests/
folder
In GitLab by @lhprice on Sep 7, 2021, 13:24
Merges lhprice-master-patch-09630 -> master
If possible it would be convient to be able to have the LHS and RHS code in the same code_eT_zhz.py
file.
Need to check if this is possible
In GitLab by @ngraymon on Apr 28, 2021, 12:34
In GitLab by @ngraymon on Aug 6, 2021, 14:50
In GitLab by @ngraymon on May 2, 2022, 16:53
In GitLab by @lhprice on Jun 10, 2021, 18:23
Merges remove_old_functions_fix -> remove_old_functions
merging the Quick fix for W generation into the reverted remove old functions file
Kind of interesting, might be cool to show evolution of residual equations for different truncations.
https://docs.manim.community/en/v0.2.0/examples.html#animations
should only need numpy inside?
then the CI/CD yaml can just say to
pip install -r <file>
instead of each specific thing
this seems more proper
Regular language?
Other possible representations?
In GitLab by @lhprice on May 3, 2021, 14:43
Merges lhprice-master-patch-16239 -> master
Missing File / Merge req test
starting from
total_list=[[(1, 1, 1, 1, 1, [1], [1]),
(1, 0, 0, 0, 0, [0], [0]),
((1,1, 2, 1),)],
[(1, 0, 0, 0, 0, [0], [0]),
(1, 0, 1, 0, 0, [0], [1]),
((1, 0, 0, 0),)],
[(0, 0, 0, 0, 0, [0], [0]),
(1, 1, 0, 0, 0, [1], [0]),
((0, 1, 0, 0),)]]
fcc._seperate_s_terms_by_connection(total_list)
next step
total_list = [
[
(1, 1, 1, 1, 1, [1], [1]),
(1, 0, 0, 0, 0, [0], [0]),
((1, 1, 2, 1),)
],
[
(1, 0, 0, 0, 0, [0], [0]),
(1, 0, 1, 0, 0, [0], [1]),
((1, 0, 0, 0),)
],
[
(0, 0, 0, 0, 0, [0], [0]),
(1, 1, 0, 0, 0, [1], [0]),
((0, 1, 0, 0),)
]
]
fcc._seperate_s_terms_by_connection(total_list)
further more
L1 = [
(1, 1, 1, 1, 1, [1], [1]),
(1, 0, 0, 0, 0, [0], [0]),
((1, 1, 2, 1),)
]
L2 = [
(1, 0, 0, 0, 0, [0], [0]),
(1, 0, 1, 0, 0, [0], [1]),
((1, 0, 0, 0),)
]
# O^1_0 h^0_0 t_0
L3 = [
(0, 0, 0, 0, 0, [0], [0]), # omega term
(1, 1, 0, 0, 0, [1], [0]), # h term
((0, 1, 0, 0),) # list of t terms
]
total_list = [ L1, L2, L3 ]
fcc._seperate_s_terms_by_connection(total_list)
In GitLab by @ngraymon on Jan 7, 2022, 12:34
Whats the deal with runners?
remove some? replace some with logging? is difficult to decide
We definitely need the Format stuff (section 4.4.5 pg 59) to add colour and spacing to our things.
I wonder if we could even generate all the equations in Maude, wouldn't that be wild
I should record ideas I have here:
[metadata "h^1_0"]
to have a string version of the equation/object?[owise]
is just completely ignored so it really does work like an else
statement0
element in the evaluation strategy (0 1 0)
actually DO!>?!?!?.fail
if there is no rule, instead the full strategy is completed before failing)(0 1 0 2 0)
for f(a,b)
which represents:a
to canonical form t
f(t, b)
b
to canonical form t2
f(t, t2)
i.e. these probably can be removed and are no longer necessary.
update latex_eT_zhz.py
with LHS code ?
$\Omega^0_0$
case (given the 4 numbers) and make sure the rules are clearA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.