Questions tagged [chemistry]

For programming questions that involve chemistry - such as questions about programmatically working with chemical formulae, simulating chemical processes, or using chemistry-related libraries and APIs. Non-programming questions about chemistry are off-topic here, but may be on-topic on chemistry.stackexchange.com.

275 questions
0
votes
1 answer

Grouping a dataframe and performing operations on the resulting matrix in a parallelized manner using Python/Dask/multiprocessing?

I am working on a project where I need to group molecules in a database by their ID and perform operations on the resulting matrix. I am using Python and I want to improve performance by parallelizing the process. I am currently loading the…
0
votes
1 answer

How to change representation of dummy atoms in SMILES format

Hi i want to perform the task of grouping the same molecular structures by using smiles code. However, even with the same structure, it is difficult to group them because the representation of dummy atoms is different. I'm using the RDKIT program…
Park
  • 27
  • 6
0
votes
0 answers

Trying to solve for 2 unknown iron source fractions given a vector of samples and a known relationship (marine chemistry exercise)

Looking for help with the class exercise that I am currently stuck on: Iron isotopes. The measured δ56Fe for dissolved Fe in the Atlantic Ocean is found in the supplementary data file found here . Assume the following endmember δ56Fe for these main…
j-asano
  • 35
  • 4
0
votes
1 answer

I don't understand the indexing of 2 electron integrals in pyscf

I am trying to create a package to do a modified version of FCI. I am trying to learn how to index determinants, solve equations using slater rules, etc. I am currently stuck on the 2 electron integrals. I need to get the set of integrals for my…
0
votes
0 answers

Proper Fourier transform in Python?

I have signal data as a function of time and want to do fft in python. I tried fft as shown below: fs = 5000 # time interval of my data fft = np.fft.fft(SIGNAL) / len(SIGNAL) fft_magnitude = abs(fft) f =…
jin
  • 11
  • 1
0
votes
0 answers

How to find the pH at the equivalence point using python

Create a function that finds the largest derivative in the derivative list. Feel free to compare with the numpy function max. Let the program print out what volume this corresponds to. This is the volume of strong base added at the equivalence…
0
votes
1 answer

converting a tree array to a specific string (chemical formulas) (py)

I have a specific kind of array which looks often like this: [{3: 'Ca'}, {2: [{1: 'P'}, {4: 'O'}]}] and I want to convert it to something like Ca3(PO4)2. Could someone help me? I tried a lot of techniques, but the code gets always really messy. I…
worte
  • 23
  • 3
0
votes
1 answer

Given 2 strings, (DNA sequences), it retrns a bool to show if a contigus sub-fragm of length >=5 exists in str1 that pairs to a fragment of str2

Given 2 strings, each containing a DNA sequence, the function returns a bool to show if a contiguous sub-fragment of length 5 or above exists in string1 that can pair w/ a fragment of str2. Here is what I tried using the functions "complement" and…
0
votes
0 answers

How to display the chemistry formula in the html input?

My input box is set as autocomplete. The list items are chemistry formulas with subscripts. I can only show the formulas on the dropdown selections. I want to show the formula format in the input box. Dropdown List with subscripted items I want like…
glpusna
  • 1
  • 1
0
votes
1 answer

Create chemical equilibrium symbol in Katex

I'm trying to create this symbol in KaTex: (I know there are the KaTex commands \xrightleftharpoons{} and \rightleftharpoons, but they make both arrows the same length.) It's for an explanation of chemical equilibrium. best I managed is putting an…
Anton
  • 563
  • 4
  • 13
0
votes
1 answer

Chemistry: TypeError: can only concatenate str (not "float") to str - I do not find any helpful answers here

Unfortunately, I'm stuck at this problem albeit it surely seems utterly ridiculous to you guys. I hope you can help me. This would be the code: (I have no idea how to show it correctly) g = input("Gebe hier das aktuelle Volumen von HCl in ml ein: ")…
0
votes
1 answer

Programmatically solve for chemical molar ratio between multiple reactions

Consider the reactions: C6.H12.O6+6O2->6H2.O1+6C1.O2 (glucose + 6oxygen ->6 water + 6carbon dioxide) 2C1.H4.O1+C1.O2->C3.H6.O3+H2.O1 (2*methanol + carbon dioxide -> 1,3-dihydroxypropanone + water) How can I programmatically figure out the molar…
0
votes
0 answers

formatting webchem pubchem output to a dataframe

I have about 3500 CAS numbers that I would like to extract the chemical information from pubchem and put into a dataframe. I have no idea on how to format the output so I can put it into a dataframe when I use the code below. The output of each call…
tom
  • 315
  • 1
  • 3
  • 10
0
votes
0 answers

How to change every number of an HTML input form into a subscript while typing?

I would like to create an HTML input form that converts every typed numerical value into a subscript. The numerical value that is typed into the input form, should immediately appear as a subscript while typing. I am making a molar mass calculator…
0
votes
1 answer

Why is If statement not working in Monte Carlo simulation?

I'm fairly new to python and am trying to run molecular dynamics simulation using Monte Carlo method wherein I construct a symmetrical system and slightly perturb a random particle and calculate the change in energy of the system. I am trying to…
lleo10
  • 1
  • 1