# Detection probability

**URL:** <https://discourse.julialang.org/t/detection-probability/20098>\
**Category:** General Usage\
**Created:** [January 25, 2019, 4:39pm UTC](https://discourse.julialang.org/t/detection-probability/20098 "2019-01-25T16:39:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)\
**Post date:** [January 25, 2019, 4:39pm UTC](https://discourse.julialang.org/t/detection-probability/20098/1 "2019-01-25T16:39:56Z")

</div>

Hi Julia Community,

i’m facing some problems with a code so i decided to run it part by part, and i have a problem with this code:

```nohighlight
		function prob(q, na, mask)
		    q0 = round(Int, q.>0)
		    m0 = round(Int, mask)
		    return prod((q0 + (1-2q0).*pdet0(na)).^m0)
		end

		psetproposal(x::Vector) = QuantumRelay.OrthoNNDist(x, ui2oc)

		new(prob, psetproposal)
	end
end

end

```

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [January 25, 2019, 6:12pm UTC](https://discourse.julialang.org/t/detection-probability/20098/2 "2019-01-25T18:12:35Z")

</div>

It would help if you described the problem you encountered, any error or other diagnostic messages you saw, and what you expected.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [January 26, 2019, 3:31pm UTC](https://discourse.julialang.org/t/detection-probability/20098/3 "2019-01-26T15:31:52Z")

</div>

[Here’s a link](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) with some suggestions for how you can formulate your question in a way that helps us to help you get to a solution.

---

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)\
**Post date:** [January 26, 2019, 3:42pm UTC](https://discourse.julialang.org/t/detection-probability/20098/4 "2019-01-26T15:42:34Z")

</div>

thank you

---

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)\
**Post date:** [January 26, 2019, 3:59pm UTC](https://discourse.julialang.org/t/detection-probability/20098/5 "2019-01-26T15:59:56Z")

</div>

well the problem that i am facing is a code divided on 4 packages and one main code where i am calling those packages. The packages are working but the main code is not i have posted the code here but this the Github link of the entire Code, the main code called “relais quantique”. i don’t see any possible way to simplify it because it’s a physical problem and i’m still new on Julia.  
[https://github.com/marouanehanhasse/info](https://github.com/marouanehanhasse/info)

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [January 26, 2019, 4:22pm UTC](https://discourse.julialang.org/t/detection-probability/20098/6 "2019-01-26T16:22:21Z")

</div>

Can you say what the error message (or unexpected behavior) is? If the packages are working, your minimal example can include `using Package1, Package2` etc as part of it. It sounds like you were able to narrow it down to a particular part of the code that’s causing the problem - can you tell us how you did that?

It’s very difficult to help when one says “my code isn’t working” when there’s not a discrete chunk of code that I can run to reproduce the problem. It is certainly a challenge to reduce your problem this way to something others can understand, but it’s a very useful exercise because it helps you understand your code (and hopefully the solution, once we find it) better.

---

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)\
**Post date:** [January 26, 2019, 4:35pm UTC](https://discourse.julialang.org/t/detection-probability/20098/7 "2019-01-26T16:35:15Z")

</div>

for now this is what the main code shows me:  
ArgumentError: Package PolyLib not found in current path:

- Run `Pkg.add("PolyLib")` to install the PolyLib package.

Stacktrace:  
[1] require(::Module, ::Symbol) at ./loading.jl:817

well i have been trying to run the PolyLib package in my machine as well but it doesn’t want too and everytime i try to run it it shows me this error:

WARNING: Base.Pkg is deprecated, run `using Pkg` instead  
in module Main  
ERROR: The following package names could not be resolved:

- PolyLib (not found in project, manifest or registry)  
Please specify by known `name=uuid`.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 26, 2019, 4:39pm UTC](https://discourse.julialang.org/t/detection-probability/20098/8 "2019-01-26T16:39:35Z")

</div>

I could only find

> **[GitHub - duguxy/PolyLib.jl: A Julia package wrapping C code of PolyLib](https://github.com/duguxy/PolyLib.jl)**
>
> A Julia package wrapping C code of PolyLib. Contribute to duguxy/PolyLib.jl development by creating an account on GitHub.

under that name, and it appears to be unregistered and quite outdated.

It may be a medium scale undertaking to bring this code and all dependencies up to date. I would advise that you put it on the back burner for now and learn Julia first, eg by working through the manual.

---

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)\
**Post date:** [January 26, 2019, 5:12pm UTC](https://discourse.julialang.org/t/detection-probability/20098/9 "2019-01-26T17:12:44Z")

</div>

that’s what i found as well when i was coding because what i wanted to do what we call in linear algebra the smith decomposition Un,n Pn,m Vm,m = Sn,m(U and P and V and S are matrices) and calculate the inverse of two matrices(U and V), the funny thing is i used this PolyLib without runing it on my machine in one package called Utility you can find it in the code if you want and it worked, i don’t know other choices how to do that altough the fact i’m stuck with this problem it doesn’t mean i stopped learning Julia, it’s just running this code it’s important for me.

Do you have any suggetions how to do that instead??
