This must be Gravity Buster: Journal #2 of a Cardboard Genius, by Frank Asch, the sequel to Star Jumper: Journal of a Cardboard Genius.
In the first book, the child genius Alex built a spaceship out of cardboard, in order to get as far away from his annoying younger brother, Jonathan, as possible. Unfortunately his creation was destroyed in a pillow fight. In the sequel he builds a spaceship twice as big as the original, and equipped with many amazing features.
As recalled in the question, one of the devices Alex builds is the "quantum sword":
Theoretically my supersword was sharp enough to slice molecules in
half! Of course, a sword like that would be a great asset aboard the
Star Jumper [his spaceship]. At the very least I could use it to
defend myself against hostile aliens. But I was sure it would come in
handy for lots of other purposes - like slicing open asteroids to look
for minerals and drinkable water or performing delicate surgeries
While testing the sword, Alex sneezes and accidentally slices his fishbowl, and pet fish, into two halves. The cut was so perfect, however, that no water leaked out and the fish continued to swim unperturbed, due to "quantum dislocation".
The series continues to a third book, where Alex builds a time machine (out of cardboard again, naturally).