Live data from Hacker News

Tofolli gates are all you need

johndcook.com

11–20 of 45 posts

Re: Tofolli gates are all you need

#11
> any Boolean function can be computed reversibly

This only holds because the system returns its raw (a, b) inputs unchanged. It doesn't seem like a useful property. Of course we can "reverse any function" if we store the inputs! Reversing here just means yielding back the inputs.

Re: Tofolli gates are all you need

#12
ok, the Landauer limit defines the minimum energy for a bit flip but I don't see how a Toffoli gate would require less energy for a bit flip let alone come into the region of the Landauer limit. Could someone with more knowledge enlighten us (or at least me)?

Re: Tofolli gates are all you need

#13
post #12

ok, the Landauer limit defines the minimum energy for a bit flip but I don't see how a Toffoli gate would require less energy for a bit flip let alone come into the region of the Landauer limit. Could someone with more knowledge enlighten us (or at least me)?

For example all the quantum computing is reversible and really doesn't want qbits to interact (hence get any energy) with the outside. So if you ignore all the supporting apparatus in theory it could work without spending energy. Toffoli gates can be used/realized in quantum computes.

Re: Tofolli gates are all you need

#14

> any Boolean function can be computed reversibly This only holds because the system returns its raw (a, b) inputs unchanged. It doesn't seem like a useful property. Of course we can "reverse any function" if we store the inputs! Reversing here just means yielding back the inputs.

> Reversing here just means yielding back the inputs.

Not quite I think - the example gate they give has (a,b,c) as input and it doesn't return c. So it's not yielding all the inputs back.

Furthermore: if you always returned all the inputs, and also computed other values, the outputs from the gates would be strictly increasing in size, so you wouldn't be able to use a finite set of gates to build a computer of arbitrary size.

Re: Tofolli gates are all you need

#15
There is a programming language that is reversible: Janus [1]. You could write a (lossless) data compression algorithm in this language, and if run in reverse this would uncompress. In theory you could do all types of computation, but the "output" (when run forward) would need to contain the old state. With reversible computing, there is no erased information. Landauer's principle links information theory with thermodynamics: putting order to things necessarily produces heat (ordering something locally requires "disorder" somewhere else). That is why Toffoli gates are so efficient: if the process is inherently reversible, less heat need to be produced. Arguably, heat is not "just" disorder: it is a way to preserve the information in the system. The universe is just one gigantic reversible computation. An so, if we all live in a simulation, maybe the simulation is written in Janus?

[1] https://en.wikipedia.org/wiki/Janus_(time-reversible_computi...

Re: Tofolli gates are all you need

#16
post #12

ok, the Landauer limit defines the minimum energy for a bit flip but I don't see how a Toffoli gate would require less energy for a bit flip let alone come into the region of the Landauer limit. Could someone with more knowledge enlighten us (or at least me)?

IANAP, but my understanding is that the Landauer limit defines the minimum energy of forcing a unknown bit into a known state. Physics as we know it is fully reversible at the microscale - every possible state have exactly one ancestor state. An irreversible process (that is, one that would force to macroscopically distinguishable states into a single one) is only possible if we conduct the "unknowness" aka entropy away from our computer - i. e. generate heat. Toffoli gate are reversible, and therefore in theory you can implement it in a way that is not subject to the Landauer limit.

Obviously, implementing one as a CMOS gate wouldn't be enough. Reversible gates would be very different. AFAIR they need to have a fan-out of one - you can't just wire an output to two inputs without losing reversibility.

Re: Tofolli gates are all you need

#17

There is a programming language that is reversible: Janus [1]. You could write a (lossless) data compression algorithm in this language, and if run in reverse this would uncompress. In theory you could do all types of computation, but the "output" (when run forward) would need to contain the old state. With reversible computing, there is no erased information. Landauer's principle links information theory with thermo…

Could you really do general compression in this language? I was under the impression that the output is always the same size or larger than the input.

Re: Tofolli gates are all you need

#18
post #12

ok, the Landauer limit defines the minimum energy for a bit flip but I don't see how a Toffoli gate would require less energy for a bit flip let alone come into the region of the Landauer limit. Could someone with more knowledge enlighten us (or at least me)?

The Landauer limit defines minimum energy for a bit *erasure*.

A reversible gate doesn't involve any such erasure and therefore Landauer's principle doesn't apply to it.

What will happen in practice if you do an entirely reversible computation is that you end up with the data you care about and a giant pile of scratch memory that you're going to need to zero out if you ever want to reuse it. Or perhaps you rewind the computation all the way back to the beginning to unscratch the scratch memory but you're going to at least need to pay to copy the output somewhere.

Re: Tofolli gates are all you need

#19

> any Boolean function can be computed reversibly This only holds because the system returns its raw (a, b) inputs unchanged. It doesn't seem like a useful property. Of course we can "reverse any function" if we store the inputs! Reversing here just means yielding back the inputs.

> Reversing here just means yielding back the inputs. Not quite I think - the example gate they give has (a,b,c) as input and it doesn't return c. So it's not yielding all the inputs back. Furthermore: if you always returned all the inputs, and also computed other values, the outputs from the gates would be strictly increasing in size, so you wouldn't be able to use a finite set of gates to build a computer of arbitr…

c is the constant 1. You don't need to store that.

> Furthermore [this doesn't scale].

Precisely.

https://en.wikipedia.org/wiki/Toffoli_gate has better details.

Re: Tofolli gates are all you need

#20

Earlier quoted context omitted.

> Reversing here just means yielding back the inputs. Not quite I think - the example gate they give has (a,b,c) as input and it doesn't return c. So it's not yielding all the inputs back. Furthermore: if you always returned all the inputs, and also computed other values, the outputs from the gates would be strictly increasing in size, so you wouldn't be able to use a finite set of gates to build a computer of arbitr…

c is the constant 1. You don't need to store that. > Furthermore [this doesn't scale]. Precisely. https://en.wikipedia.org/wiki/Toffoli_gate has better details.

c is an actual input variable, it's not a constant. You can set it to be the constant 1 which the article does in one of the examples, but this isn't mandatory.
Post reply on HN