Skip to content

Commit

Permalink
Added PTR Verifications
Browse files Browse the repository at this point in the history
PTR-BG verification added
PTR-BCR-1 verification added
  • Loading branch information
Matt1nAHat committed Jan 21, 2021
1 parent 50555c3 commit 57a732c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions everything_else/reproducing.m
Expand Up @@ -34,6 +34,20 @@
RHS=min(reshape((6 - 1 - b1 - b2 - b3 - b4 - b5 - b6).*ba,2,[]));
isequal(LHS,RHS);

%% PTR_BG Pg: 17, Eqn 50

b = dec2bin(2^6-1:-1:0)-'0';
b1=b(:,1);b2=b(:,2);b3=b(:,3);b4=b(:,4);ba1=b(:,5);ba2=b(:,6);
LHS = b1.*b2.*b3.*b4;
RHS = ba1.*(2+ b1 -b2 - b3 - b4) + ba2.*(1 + b2 - b3 - b4) + b3.*b4;

%% PTR-BCR-1: Pg. 20, Eqns 59

b = dec2bin(2^5-1:-1:0)-'0';
b1=b(:,1);b2=b(:,2);b3=b(:,3);b4=b(:,4);ba1=b(:,5);
LHS = b1.*b2.*b3.*b4;
RHS = 1/2*(b1 + b2 + b3 + b4 - 2*ba1).*(b1 + b2 + b3 + b4 - 2*ba1 - 1);

%% NTR-GBP: -b1b2b3 = min_ba(ba - b1 + b2 + b3 - b1b2 - b1b3 + b1)

b= dec2bin(2^4-1:-1:0)-'0';
Expand Down

1 comment on commit 57a732c

@ndattani
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the isequal line, we don't know whether or not LHS and RHS are equal. Also LHS and RHS won't be equal unless we have the min(reshape( commands. Can you please go through and add those? If you see the quadratizations in your commit here, there's just LHS and RHS but no reshaping, no minimization, and no isequal command. If you could go through the rest of the reproducing.m file and add the appropriate lines wherever they're missing, it would be a great help!

Please sign in to comment.