Stochastic Concurrent Logic Programming

 
As of the time of this writing, no quantum logic programming language has been proposed yet, but things may change in the future.
 
 

The term ‘stochastic’ in this note will refer to two types of probability:

stochastic = classical-probabilistic + quantum-probabilistic

or, simply

stochastic = probabilistic + quantum

 
 

The guarded Horn clause (GHC)

From Wikipedia:Concurrent_logic_programming:

Concurrent logic programming is a variant of logic programming in which programs are sets of guarded Horn clauses (GHCs) of the form:

     H :- G1, …, Gm | B1, …, Bn.

The conjunction G1, … , Gm is called the guard of the clause, the conjunction B1, …, Bn. the body of the clause and | is the commitment operator.

However, procedurally, when there are several clauses whose heads H match a given goal, then all of the clauses are executed in parallel, checking whether their guards hold. If the guards of more than one clause hold, then a committed choice is made to one of the clauses, and execution proceeds with the subgoals [the body] of the chosen clause. These subgoals can also be executed in parallel. Thus concurrent logic programming implements a form of “don’t care nondeterminism”, rather than “don’t know nondeterminism”.

 
 

The probabilistic guarded Horn clause (PGHC)

     H :- G1, …, Gm : P | B1, …, Bn.

Final term of the guard is a positive number or logical variable that is bound to a nonnegative number at the completion of the other guard terms. j may be 0. The body Bn committed to is chosen probabilistically by summing the Ps of all candidate bodies and normalizing by dividing each P by the sum to get a probability distribution.

 

The quantum guarded Horn clause (QGHC)

A QGHC is of the form

     H1 :- G1,1, …, G1,m_1 : Q1; …; Hk :- Gk,1, …; Gk,m_k : Qk ¦ I.

or

     H1 :- G1,1, …, G1,m_1 : Q1; …; Hk :- Gk,1, …; Gk,m_k : Qk | B1, …, Bn.

Head is a disjunction separated by semicolon character ‘;’. (Priority of operators: ‘|’, ‘¦’, ”;’, ‘:-‘.) of PGHC-type head+guards EXCEPT final term of each guard is a complex number or logical variable that is bound to a complex number at the completion of the other guard terms.

I (in first type ofQGHC) is an intermediate head (single term goal) and ¦ (broken vertical bar) is the intermediate commit. (I could also be N, for “neck”.)

The disjunctive head+guards are called ‘superpositions’, and their resultant probability is determined by the Feynman ‘sum over histories’ rule:

     Q = Q1 + … + Qk
     P = |Q|

In the intermediate commit case, the goal I proceeds with the effect of producing cross product complex probabilities, as this example shows:

a1(X,Y,Z) :- X=1 : q11 ; a1(X,Y,Z) :- X=2 : q12 ¦ a2(X,Y,Z).

a2(X,Y,Z) :- Y=1 : q21 ; a2(X,Y,Z) :- Y=2 : q22 ¦ a3(X,Y,Z).

a3(X,Y,Z) :- Z=1 : q31 ; a3(X,Y,Z) :- Z=2 : q32 | Body.

has the effect of

a1(X,Y,Z) :- X=1 , Y=1 : , Z=1 : q11*q21*q31 ; …; a1(X,Y,Z) :- X=2 , Y=2 : , Z=2 :q12*q22*q32 | Body.

 

Only when the final commit | (vertical bar) is reached is the sum and norm taken.

With intermediate commits, reducing a goal leading to each each commit results ia tree with complex numbers down the nodes of each branch. At the leaves (commits) of the tree the resulting complex number is the product of the node complex numbers. The tree’s weight is given by the norm of the sum of the leaf complex numbers.

With multiple clauses with intermediate commits, this process is repeated. Only when all commits are reached is the single selection made based on the resulting distribution created by the norms.

 
 

Superpositional bindings (unifications) of intraprocess logical variables are undone.

Example:

a(1, Q) :- Q1 is Q×(1.0+1.0i) : Q1; a(2, Q) :- Q1 is Q×(1.0-1.0i) : Q1 | print(‘A’).
a(1, Q) :- Q1 is Q×(-1.0+1.0i) : Q1; a(2, Q) :- Q1 is Q×(-1.0-1.0i) : Q1 | print(‘B’).

:- Q is 2.0-3.0i, a(X,Q).

(X not bound at resolution.)

 
 

States of logical variables:

1. unbound
2. readonly (unbound)
3. counterfactual
4. bound

A logical variable in superpositions- prior to a commit – after a commit is counterfactual (and may never be bound).

cf. Counterfactual Logic Gates – https://arxiv.org/abs/2001.09430

Read-only logical variables in QGHCs and teleportation via shared interprocess logical variables.

 

to be added

cf. https://codicalist.wordpress.com/2018/04/08/cp-stochastic-concurrent-prolog/

examples …

 
 
measure(M) :- measure(M,_,list of complex numbers).

measure(a,1,Q) :- nth1(Q,1, Qa1) : Qa1;
measure(a,2,Q) :- nth1(Q,2, Qa2) : Qa2
      | print(a).
measure(b,1,Q) :- nth1(Q,3, Qb1) : Qb1;
measure(b,2,Q) :- nth1(Q,4, Qb2)) : Qb2
      | print(b)

 
 

Minding your tochastic Ps and Qs

1. events and (real) probabilities

event ei, i = 1,…,n
probability pi in [0.0,1.0], i =1,…,n
distribution = { e1*p1, … , en*pn }

where sumi pi = 1.0

 

2. events, counterevents, and complex probabilities

counterevent ei_j i = 1,…, n ; j = 1,… m_i
/* complex probability qi_j in (complex) circle group */

eventi = { ei_1*qi_1, … ei_n_i*qi_n_i }
/* each event is a superposition of counterevents */

distribution = { e1*p1, … , en*pn }

where
      zi = |sumj qi_j|
      z = sumi zi
      pi = zi/z

 

other refs:

1. Complex Measures

Click to access Michael%20Tang%2016.pdf

2. Counterfactuals in Quantum Mechanics

Click to access m105.pdf

from Lev Vaidman
https://m.tau.ac.il/~vaidman/

3. Exotic Probability Theories and Quantum Mechanics: References

http://physics.bu.edu/~youssef/quantum/quantum_refs.html

4. Co-Events and Quantum Measure Theory:

Philip Thrift

 
 
 

Leave a comment