Tag Info

5

This model is implemented using Julia's DifferentialEquations.jl in this tutorial. Here's a version of that code: using DifferentialEquations using StochasticDiffEq using DiffEqCallbacks using Random using SparseArrays using DataFrames using StatsPlots using BenchmarkTools function sir_ode!(du,u,p,t) (S,I,R) = u (β,c,γ) = p N = S+I+R @...

2

Edit: I looked at the paper you linked in the comment. I'm no expert in quantum computing, but it seems like a hot mess. The notation is certainly not clear to me, but if you can clear it up then I'll edit this formulation. The following is my best guess. I believe you have a number of typos. First, I believe you are conflating equivalent expressions for ...

1

In divround, pint and qint must be the integer parts of pfrac and qfrac, However, as I understand, in Python, converting a float to an int always rounds it towards 0, i.e., positive floats are rounded down, but negative floats are rounded up, so int(-2.7) is -2, not -3. Instead of pint, qint = [int(thing) for thing in (pfrac, qfrac)] you should have pint, ...

Only top voted, non community-wiki answers of a minimum length are eligible