Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"three": "^0.179.1"
}
}
15 changes: 11 additions & 4 deletions qubitverse/visualizer/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import React, { useState, useRef } from 'react';
import React, { useState } from "react";
import QuantumCircuit from "./components/QuantumCircuit";
import "./App.css";
import Navbar from "./components/Navbar";
import NQubitInput from "./components/NQubitInput";
import BlochSphere from "./components/BlochSphere";

function App() {
const [nQubits, setNQubits] = useState(null);
const [showBloch, setShowBloch] = useState(false);

return (
<>
<Navbar />
{nQubits === null ? (
<Navbar
onBlochToggle={() => setShowBloch(!showBloch)}
isBlochActive={showBloch}
/>
{showBloch ? (
<BlochSphere key="bloch-sphere" />
) : nQubits === null ? (
<NQubitInput numQubits={nQubits} setQubits={setNQubits} />
) : (
<QuantumCircuit numQubits={nQubits} setNumQubits={setNQubits} />
Expand All @@ -19,4 +26,4 @@ function App() {
);
}

export default App;
export default App;
Loading