Coder Social home page Coder Social logo

Comments (4)

newexo avatar newexo commented on July 18, 2024

Wait a minute, @garden-of-delete . Please look at src/tests/clkTests.cpp lines 718-728. These seem to be for q=3.

Is the task to check that these match literature?

from recombo_public.

newexo avatar newexo commented on July 18, 2024

Unfortunately, it does not appear that I have access to "Monte Carlo Study of Polymer Systems by Multiple Markov Chain Method" by Enzo Orlandini. Was there another which might have contained computed examples?

from recombo_public.

newexo avatar newexo commented on July 18, 2024

Okay. I have Schmirler's thesis. I will compute by hand probabilities for two z-values and two q-values using equations 4.7 on page 52 and write a test that checks against those hand computed probabilities.

https://central.bac-lac.gc.ca/.item?id=TC-SSU-201209670&op=pdf&app=Library&oclc_number=1032987533

from recombo_public.

garden-of-delete avatar garden-of-delete commented on July 18, 2024

We have confirmed that the bfacf probability for P(-2) being computed in the probmap for q > 1. The test here:

bool testPrecomputedBfacf3Probs(){
	clkCigar square;
	clkConformationAsList square1(square);
	testClkConformationBfacf3 knot(square1);
	//select a z with q=1
	double z = .2000, q = 1;
	//precompute probabilities
	knot.init_Q(z, q);
	//compare precomputed probabilities with directly computed probabilities
	for (int n = 4; n < MAX_PRECOMPUTE_LENGTH; n++){
		ASSERT(knot.probMap[n].p_plus2 == (pow((n + 2), (q - 1))*(z * z)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z));
		ASSERT(knot.probMap[n].p_minus2 == pow(n, (q - 1)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z));
		ASSERT(knot.probMap[n].p_0 == .5*((pow((n + 2), (q - 1))*(z * z)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z) +
			pow(n, (q - 1)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z)));
	}
	//select a different z with q=3
	z = .1812; q = 3;
	//precompute
	knot.init_Q(z, q);
	//compare
	for (int n = 4; n < MAX_PRECOMPUTE_LENGTH; n++){
		ASSERT(knot.probMap[n].p_plus2 == (pow((n + 2), (q - 1))*(z * z)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z));
		ASSERT(knot.probMap[n].p_minus2 == pow(n, (q - 1)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z));
		ASSERT(knot.probMap[n].p_0 == .5*((pow((n + 2), (q - 1))*(z * z)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z) +
			pow(n, (q - 1)) / (pow(n, (q - 1)) + 3.0*pow((n + 2), q - 1) * z * z)));
	}
	
	return true;
}

failed to catch the issue because the expression it is comparing the probmap to is also wrong.

Steps to resolve this issue:

  1. Fix the broken test
  2. Find and fix the expression that is miscomputing these probabilities in the probMap
  3. Verify the test passes

from recombo_public.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.