Changeset d083cc for tests/Python/ForceAnnealing/pre/ising_model_chain.py
- Timestamp:
- Jan 24, 2024, 12:09:57 AM (21 months ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- 5a479d
- Parents:
- 6dde30
- git-author:
- Frederik Heber <frederik.heber@…> (01/24/24 00:09:17)
- git-committer:
- Frederik Heber <frederik.heber@…> (01/24/24 00:09:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/Python/ForceAnnealing/pre/ising_model_chain.py
r6dde30 rd083cc 8 8 9 9 if len(sys.argv) < 5: 10 print 'Usage: '+sys.argv[0]+' <input> <path> <steps> <no_atoms> <use bondgraph>'10 print('Usage: '+sys.argv[0]+' <input> <path> <steps> <no_atoms> <use bondgraph>') 11 11 sys.exit(1) 12 12 … … 21 21 # creating input file 22 22 atomstart=7.6-1.6*math.floor(no_atoms/2) 23 print "Creating "+inputfile23 print("Creating "+inputfile) 24 24 with open(inputfile, 'w') as f: 25 25 f.write("# ATOMDATA\ttype\tId\tx=3\tu=3\tF=3\tneighbors=4\n") … … 36 36 f.write("C\t%d\t%lg\t10\t10\t0\t0\t0\t0\t0\t0\t%d\t%d\t0\t0\n" % (i, atompos, i-1, i+1)); 37 37 38 print "Parsing from "+inputfile38 print("Parsing from "+inputfile) 39 39 mol.WorldInput(inputfile) 40 40 mol.SelectionAllAtoms() … … 53 53 print("Roots of p "+str(p)+" are "+str(zeros)) 54 54 damping=numpy.real(zeros[-1]) 55 print "Using damping factor of "+str(damping)55 print("Using damping factor of "+str(damping)) 56 56 else: 57 57 if no_atoms == 2: … … 82 82 continue 83 83 line=line.replace('\t',' ') 84 print "LINE: "+line84 print("LINE: "+line) 85 85 [elementtype, X, Y, Z] = line.split(' ', 4) 86 86 if coords!=[0.,0.,0.]: … … 88 88 coords=[float(X),float(Y),float(Z)] 89 89 except IOError: 90 print 'Warning: '+outputfile+' not readable.'90 print('Warning: '+outputfile+' not readable.') 91 91 sys.exit(1) 92 92
Note:
See TracChangeset
for help on using the changeset viewer.
