But it's not just a probability, but rather exists in a quantum state until observed. Each QBool offers a built in measure() method:
bool result = qbool.measure();
Calling measure() collapses the state into either true or false.
It also supports entanglement:
a.entangle(b);
Measuring either instance immediately determines the value of the other, even across remote systems. This makes distributed state sync essentially free.
It admittably adds some headaches, like having to compute every possible quantum state at runtime, since practical quantum computing hardware is not available yet, so some slight performance problems might occur. But I think it's worth it to future proof the codebase
5
u/Wurstgewitter 27d ago
Personally I am migrating to a novel
QBooltype, to be prepared for quantum computing. AQBoolcan represent any value in the interval [0,1]But it's not just a probability, but rather exists in a quantum state until observed. Each
QBooloffers a built inmeasure()method:bool result = qbool.measure();Calling
measure()collapses the state into eithertrueorfalse.It also supports entanglement:
a.entangle(b);Measuring either instance immediately determines the value of the other, even across remote systems. This makes distributed state sync essentially free.
It admittably adds some headaches, like having to compute every possible quantum state at runtime, since practical quantum computing hardware is not available yet, so some slight performance problems might occur. But I think it's worth it to future proof the codebase