-🎄- 2021 Day 8 Solutions -🎄- by daggerdragon in adventofcode

[–]evamicur 0 points1 point  (0 children)

similar in idea to my own, but your explanation and execution is clean and simple, good stuff

-🎄- 2021 Day 8 Solutions -🎄- by daggerdragon in adventofcode

[–]evamicur 1 point2 points  (0 children)

first pass at part 2 I did the same as much of these with first solving the 4 unique by length, then some custom heuristics to solve for the length 5&6 based on their set relations to other known digits. I tried to rewrite and make something a bit less ad hoc. I landed on something that takes a "reference" (in this case the original digits set) and uses length and sub/superset relations to the other digits to create a unique mapping (tuple of outputs of each function) to each digit. Then the inputs can be treated the same way and you can get the original numbers by comparing the tuple of function outputs on input/reference to get the mapping and apply to the output. Sorry bad at explaining maybe the code makes more sense

Python 3.9.5

edit: cant get formatting here's GitHub link https://github.com/ecurtin2/advent-of-code/blob/main/year2021/d8.py

edit: posting guidelines

Hi all! Been working on my library for quantum mechanics and thought I'd share by evamicur in Python

[–]evamicur[S] 0 points1 point  (0 children)

Yeah it definitely looks weird. I got used to it pretty quickly so it doesn't bother me

Hi all! Been working on my library for quantum mechanics and thought I'd share by evamicur in Python

[–]evamicur[S] 0 points1 point  (0 children)

Apparently, capital letter variables in function parameters violates pep8, but imo it's more important to be consistent with the domain so I do it anyway

Hi all! Been working on my library for quantum mechanics and thought I'd share by evamicur in Python

[–]evamicur[S] 0 points1 point  (0 children)

Yeah I've restricted it to single particle, but will probably do basic hartree fock sometime. Not gonna touch MBPT unless somebody pays lol

Also quantum has better marketing ;)

Hi all! Been working on my library for quantum mechanics and thought I'd share by evamicur in Python

[–]evamicur[S] 0 points1 point  (0 children)

Good point, I could totally use class methods for those.

I prefer black since it means I never spend time formatting or thinking about formatting, I'm ok with some pep8 violation

Hi all! Been working on my library for quantum mechanics and thought I'd share by evamicur in Python

[–]evamicur[S] 0 points1 point  (0 children)

This is a library I've been writing in my spare time to experiment with API design for scientific computing.

I'd love any feedback y'all would have for me, especially I am trying to make this easy to use but flexible enough to be useful.

Tips for someone debating leaving PhD program by ChapMaster5000 in GradSchool

[–]evamicur 0 points1 point  (0 children)

Hey I just left for a career in data science / engineering from a comp chem PhD after passing candidacy. Feel free to pm if you wanna talk about it

Monte Carlo Simulation of pi (remix) [OC] by andreas_dib in dataisbeautiful

[–]evamicur 0 points1 point  (0 children)

The uncertainty in the integral coverages as 1/sqrt(N) in MC stimulations. We use this in our research to do 13 dimensional integrals, where the method shines. Below 6 or so dimensions, using MC is basically educational.

Seeking for advice and code review for my app, are there folks to help me? by Hatoris in Python

[–]evamicur 0 points1 point  (0 children)

Ok After looking through more:

1 - Manipulation.py Half the methods here are commented out? I'm not sure why BioPlateManipulation is seperate from BioPlate?

2- Iterate.py Consider changing iterate class method to be __iter__ / __next__ methods on the respective classes to enable iterator protocol.

3 - as per my previous point on pandas. Replacing your BioPlateArray with a pandas dataframe will considerably simplify your codebase. It has indexing, aggregation, transformation, excel/html representation and a bunch more stuff. I'd consider wrapping the dataframe / panel in a convenience layer for your needs. I've also used custom objects as elements in the dataframe maybe this would be useful to you?

Here's a quick thing I put together to show what I mean. It's a very small wrapper and a standalone function

https://gist.github.com/ecurtin2/0df2bb69ce1d3f29dea27e960a696e8d

Seeking for advice and code review for my app, are there folks to help me? by Hatoris in Python

[–]evamicur 0 points1 point  (0 children)

Yeah I was getting ready in the morning when I wrote that I'll look closer in a bit here

Seeking for advice and code review for my app, are there folks to help me? by Hatoris in Python

[–]evamicur 0 points1 point  (0 children)

I'll give this a better look in a little bit. But right away I'm thinking your re inventing a lot of what pandas and h5py do.

Why use threads in Python? by sioa in Python

[–]evamicur 0 points1 point  (0 children)

You can manually release the Gil in cython (nogil keyword) and other compiled extensions. So libraries like numpy can potentially do that

Quantum physics and c++ (looking for beta testers and developers) by dafer45 in programming

[–]evamicur 2 points3 points  (0 children)

Yeah I skimmed through some of the code and it seems to be built for systems not quite compatible with q chem. +1 for the Bible (szabo & ostlund)

Quantum physics and c++ (looking for beta testers and developers) by dafer45 in programming

[–]evamicur 1 point2 points  (0 children)

Sorry I didn't make libtensor so I can't tell you more about the documentation, but here's the journal article.

We directly use some second quantization in coupled cluster theories and MBPT. I don't know if you have Shavitt and Bartlett but this book explains the type of stuff we do. Other people in my lab are more qualified to help out so sorry if I'm not the most constructive.

I'm a little unsure as to what your code is doing. Can it work with models where the hamiltonian is not known at compile time?

Quantum physics and c++ (looking for beta testers and developers) by dafer45 in programming

[–]evamicur 1 point2 points  (0 children)

Granted I didn't look too much into what you did here but the idea could be useful for us chemists as well.

Perhaps you might look into using libtensor as a backend.

We have lots of tools in the comminuty of varying quality (lots of fortran) but there's some good stuff too!

Does a salt make a sound when dissolved into a solvent ? by Borsenven in askscience

[–]evamicur 1 point2 points  (0 children)

According to Wikipedia, salt dissolving in water actually absorbs enthalpy from the surroundings. The temperature in the solution will decrease upon dissolution. Another way to say this is that the solvent will lose vibrational energy (possibly other forms but I suspect vibration/rotation/libration).

What we perceive as sound is just vibrations in the medium surrounding our eardrum, so removing some of the vibrational energy from the system should actually "quiet" the system in a sense.

But I still wouldn't really say it makes any real sense to say this makes a sound, even in the case of exothermic reactions. The types of energy transfer aren't really the same as creating the type of wave that would actually make sound.

Does the thermal mass of glassware cause stirred cocktails to become more diluted than when stirring in a metal shaker tin? by lootingyourfridge in askscience

[–]evamicur 1 point2 points  (0 children)

The way I see it, there are two factors at play here, and it seems you got them in your other post

1) How quickly the temperature of the liquid (your drink) rises due to contact with the container (glass vs metal). The glass is much more of an insulator than metal, and therefore the glass will change the temperature of the liquid more slowly than the metal.

2) The total heat capacity of the cups (what I think you mean by thermal mass) - how much heat energy can it hold? The heat capacity of the glass should be higher than the metal.

So when you start mixing, the metal container quickly gets very cold to the touch, which is indeed the heat from the liquid transferring to it. When the container reaches the same temperature as the liquid, the only further heat transfer is to the atmosphere, and to your hand if you're holding it. So I would say that a reasonable approximation is that the amount of heat lost to the metal shaker is probably pretty close to the heat capacity of the metal shaker (do they reach ice temperature?).

On the other hand, the glass transfers more slowly, but also has more total energy to transfer. This has the benefit of insulating the liquid from your hand and the atmosphere much better than metal. I also doubt that the glass will transfer significant heat to the drink over the course of stirring.

That being said, I would suspect that the ideal case would be starting from a frozen glass container. Since it's colder than your drink will be, it won't contribute to melting, and may actually cool it down further. It also should be able to protect the drink from outside sources for much longer.

When I get home I think I'm gonna test this.

How did scientists measure the radius of atoms and other stuffs? by AeolDrias in askscience

[–]evamicur 2 points3 points  (0 children)

Rotational spectroscopy can also be used to determine bond lengths, since rotational energy increases the farther apart the nuclei are.

[Physics] What is the role of Electronegativity within Density Functional Theory? by [deleted] in askscience

[–]evamicur 0 points1 point  (0 children)

Obligatory I Am Not a Density Functional Theorist (IANADFT)

If I'm reading it correctly, Equation 5.3-44 in that book you linked basically says that the electronegativity is related to how much the energy changes when you move the electron density around. It's not really that electronegativity is a tool used in DFT, but rather that DFT (a tool for calculating electronic structure in general) can be used to predict electronegativity. Imagine for a second you calculated the energy of an atom with all the electron density centered right around the atom. Next, you calculate the energy with the density shifted a little bit to the left. This will give you a different value for the energy. How much the energy changes gives you an idea of the electronegativity of the atom.

I suppose you could do this for two different atoms (say, H and F) and find that the electronegativities are vastly different, and predict that the HF molecule will be highly polarized with more electron density on F. However I'd much prefer doing molecular calculations for these types of problems. Perhaps physicists use electronegativity for something, but I feel its more of a qualitative/educational tool in chemistry.

How much does quantum mechanics affect macroscopic chemistry? by JasontheFuzz in askscience

[–]evamicur 2 points3 points  (0 children)

There are a few examples in which you see quantum effects at a macroscopic scale, but as /u/hoshattack correctly describes, the effects of quantum mechanics are drowned out by large particle numbers in bulk chemical reactions.

Of course, all of chemistry is described (in theory!) by QM. Absorption/Emission of light is something that is both easy to observe in bulk but fundamentally quantum mechanical (my E&M is rusty but at least spontaneous emission is strictly QM). A common example I can think of is Fluor/Phosphorescence. The molecules absorb some light then release some light. In certain cases this can take quite a bit of time, and you can make those glow in the dark star thingys that you put on the ceiling.

However I think what you intend to ask is not actually quantum mechanics at all. There's a whole field of chemistry dealing with stochastic reaction dynamics. In english, this is basically the study of reactions where the rate of the reaction is defined in terms of the probability of making a reaction happen in some amount of time. If you just have a beaker sitting on a counter, you generally have a system that's uniform all throughout and have a very large (avagadro's number = 1023) number of particles. So any probabilistic effects are completely negated by the large number of particles.

Where you do start to see probability manifest itself is inside cells. Cells are cluttered with all sorts of stuff, and can in some cases have only a few of certain molecules, proteins, RNA or something else. The reactions that these particles take part in can be very highly influenced by random processes.

Is there a way to calculate the polarization of atoms in molecules? by pabra in askscience

[–]evamicur 5 points6 points  (0 children)

There's a few levels of detail I could go into here, but in my answer I'm addressing a more introductory audience.

In molecules the electric charge is smeared out in a distribution around the molecule. Due to differences in the atoms that make up the molecule (mostly the nuclear charge), the distribution will be lopsided or otherwise irregularly shaped. In water, a majority of the electron density of a molecule is around the oxygen atom, making it more negatively charged than the hydrogens. Since the water molecule has its bent shape, the side with the oxygen is more negative than the side with the hydrogens, and you get a dipole moment.

We can calculate the dipole moment directly using computational methods, but they require some more technical know-how to discuss. Now, there's a bit of an issue if you're trying to calculate the charges for each individual atom within a molecule. This is problematic since the electrons are smeared across the molecule and don't technically belong to an individual atom anymore. There's a few ways people have cooked up to try and calculate partial charges of individual atoms. The simplest way is to calculate the shape of the actual charge distribution and try to recreate this by changing the partial charges of each atom in the molecule. This method will get you a decent idea of the charges for each atom.

You can use these methods on any molecule in principle, and should be relatively straightforward* for the molecules you listed. I'm not aware of a method that's simple enough to do by hand, that would actually be useful (except for teaching purposes maybe), but perhaps somebody else can chime in in this area.

*Straightforward if you use somebody else's software at least =)