Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • N NIFTy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 19
    • Issues 19
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ift
  • NIFTy
  • Issues
  • #175
Closed
Open
Issue created Aug 06, 2017 by Martin Reinecke@mtrOwner

Indexing bug in Laplace operator

I'm running the following test case on current master:

from nifty import *

s_space = RGSpace([256,256])
FFT = FFTOperator(s_space)
h_space = FFT.target[0]
p_space = PowerSpace(h_space, logarithmic=True, distribution_strategy='not')

t0 = Field(p_space, val=log(0.1/(1+p_space.kindex)**3))
sop = SmoothnessOperator(p_space)

#print t0.val.get_full_data()
print t0.vdot(sop(t0))
#print t0.val.get_full_data()
print t0.vdot(sop(t0))

This produces the output:

0.645594411887
139746.578501

which is definitely incorrect, since the same number should be reported twice.

Things become even weirder. If I remove the commenting "#" from the first print statement, I get:

[ -2.30258509  -4.38202663  -4.94670585  -5.75181152  -6.49001612
  -7.17883085  -8.05624052  -8.99425111  -9.93125436 -10.87947582
 -11.85503513 -12.85994974 -16.24599361]
2.93684941121
139746.578501

So the print statement changes the result of the next statement?!

Removing the next "#" as well produces:

[ -2.30258509  -4.38202663  -4.94670585  -5.75181152  -6.49001612
  -7.17883085  -8.05624052  -8.99425111  -9.93125436 -10.87947582
 -11.85503513 -12.85994974 -16.24599361]
2.93684941121
[ -2.30258509  -4.38202663  -4.94670585  -5.75181152  -6.49001612
  -7.17883085  -8.05624052  -8.99425111  -9.93125436 -10.87947582
 -11.85503513 -12.85994974 -16.24599361]
2.93684941121

First question: can anyone reproduce this, or is it a bug in my local Python installation?

If this is reproducible, it definitely needs to be fixed quickly, but I'm completely at my wits' end ...

Edited Aug 07, 2017 by Martin Reinecke
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking