News for hackers. Stuff that matters.
Re:What would a very simple quantum program look like? by yellowapple on Wednesday June 14, 2017 @11:38AM (#14553505)
I really like how Perl's Quantum::Entanglement [0] looks/feels/works. Said package's documentation also has some nifty examples of how it (and actual quantum programming) could be used. In particular:

    $gas = entangle(1, 'bottled', 1, 'released');
      # gas now in states |bottled> + |released>
    
    $cat_health = p_op($gas, 'eq', 'released',
                            sub {'Dead'},
                            sub {'Alive'});
      # cat,gas now in states |Alive, bottled> + |Dead, released>
    
    if ($cat_health eq 'Dead') {# again, outcome is probabilistic
      # thus gas = |released>
    }
    else {
      # thus gas = |bottled>
    }
I don't know if this is "real" quantum programming, but it's pretty cool regardless.

[0]: http://search.cpan.org/~ajgough/Quantum-Entanglement-0.32/En...

There are no comments on this comment yet.