var searchIndex = {}; searchIndex["quantum"] = {"doc":"Advanced Rust quantum computer simulator.","items":[[0,"complex","quantum","Complex number library code (public for pedagogical reasons).",null,null],[3,"Complex","quantum::complex","Holds a complex number with 64-bit float parts.",null,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"clone","","",0,null],[11,"new","","Construct a new complex number with 64-bit float parts.",0,{"inputs":[{"name":"f64"},{"name":"f64"}],"output":{"name":"complex"}}],[11,"norm_sqr","","Compute the square of the norm/absolute value, i.e. _|z|^2_.",0,null],[11,"zero","","Zero in the complex plane, i.e. `0 + 0i`.",0,{"inputs":[],"output":{"name":"complex"}}],[11,"one","","One in the complex plane, i.e. `1 + 0i`.",0,{"inputs":[],"output":{"name":"complex"}}],[11,"add","","",0,null],[11,"mul","","",0,null],[11,"add_assign","","",0,null],[0,"computer","quantum","Main consumer module allowing easy control of whole quantum computer.",null,null],[3,"QuantumComputer","quantum::computer","Represents a quantum computer of one register.",null,null],[11,"fmt","","",1,null],[11,"new","","Construct a new quantum computer with register of given `width`.",1,{"inputs":[{"name":"usize"}],"output":{"name":"quantumcomputer"}}],[11,"initialize","","Initialize the quantum register qubits to a certian classical integer state.",1,null],[11,"apply","","Apply a quantum gate to the quantum register qubits.",1,null],[11,"collapse","","Collapse the quantum register to a classical state.",1,null],[11,"reset","","Reset the quantum register, ready to be initialized again.",1,null],[11,"value","","Read the collapsed register qubits as an integer.",1,null],[0,"gate","quantum","Gate library code (public for pedagogical reasons).",null,null],[3,"Gate","quantum::gate","Represents a _quantum gate_: a quantum regster transformation.",null,null],[11,"fmt","","",2,null],[11,"new","","Construct a new quantum gate, given `width` and computational basis matrix.",2,{"inputs":[{"name":"usize"},{"name":"matrix"}],"output":{"name":"gate"}}],[11,"width","","Width of the gate.",2,null],[11,"matrix","","Representative matrix.",2,null],[0,"gates","quantum","Implementations of quantum gates, intended for consumer use.",null,null],[5,"identity","quantum::gates","The identity gate, not mutating the state at all.",null,{"inputs":[{"name":"usize"}],"output":{"name":"gate"}}],[0,"ket","quantum","Ket library code (public for pedagogical reasons).",null,null],[3,"Ket","quantum::ket","A ket describes the state of a quantum register.",null,null],[12,"elements","","The ket's elements, w.r.t. the computational basis.",3,null],[11,"eq","","",3,null],[11,"ne","","",3,null],[11,"fmt","","",3,null],[11,"clone","","",3,null],[11,"new","","Construct a new, zero-initialized ket of given size.",3,{"inputs":[{"name":"usize"}],"output":{"name":"ket"}}],[11,"from_classical","","Generate a ket from a classical register.",3,{"inputs":[{"name":"classicalregister"}],"output":{"name":"ket"}}],[11,"is_valid","","Is this structure a valid ket?",3,null],[11,"is_classical","","Determine whether this ket represents a classically possible state.",3,null],[11,"size","","Compute a ket's size from the register width.",3,{"inputs":[{"name":"usize"}],"output":{"name":"usize"}}],[11,"apply","","Apply a quantum gate to this ket, mutating its state.",3,null],[0,"matrix","quantum","Matrix library code (public for pedagogical reasons).",null,null],[3,"Matrix","quantum::matrix","Represents a square matrix over C of maximum size `MAX_SIZE`.",null,null],[6,"Vector","","Efficient array of complex numbers.",null,null],[17,"MAX_SIZE","","Max size of matrix and therefore ket.",null,null],[11,"new","","Construct a new zero-initialized matrix of given size.",4,{"inputs":[{"name":"usize"}],"output":{"name":"matrix"}}],[11,"identity","","Construct a new identity matrix of given size.",4,{"inputs":[{"name":"usize"}],"output":{"name":"matrix"}}],[11,"size","","Size of the matrix.",4,{"inputs":[{"name":"matrix"}],"output":{"name":"usize"}}],[11,"get","","Get the element in position `(i, j)`.",4,{"inputs":[{"name":"matrix"},{"name":"usize"},{"name":"usize"}],"output":{"name":"complex"}}],[11,"set","","Set the element in position `(i, j)` to `value`.",4,{"inputs":[{"name":"matrix"},{"name":"usize"},{"name":"usize"},{"name":"complex"}],"output":null}],[11,"fmt","","",4,null],[11,"eq","","",4,null],[0,"other","quantum","(public for pedagogical reasons).",null,null],[0,"qubit","quantum::other","Single qubit library code.",null,null],[3,"NonEntangledQubit","quantum::other::qubit","Represents a single (pure, not entangled) qubit state of the form `a|0> + b|1>`.",null,null],[11,"fmt","","",5,null],[11,"clone","","",5,null],[11,"new","","Safely construct a qubit, given the real and imaginary parts of both coefficients.",5,{"inputs":[{"name":"f64"},{"name":"f64"},{"name":"f64"},{"name":"f64"}],"output":{"name":"nonentangledqubit"}}],[11,"validate","","Validate that this qubit's state is possible.",5,null],[0,"registers","quantum","Classical and quantum register library code (public for pedagogical reasons).",null,null],[3,"QuantumRegister","quantum::registers","Represents a register of an arbitrary number of qubits.",null,null],[3,"ClassicalRegister","","Represents a non-quantum register of `width()` bits.",null,null],[11,"fmt","","",6,null],[11,"new","","Construct a new quantum register of given `width` and initial state.",6,{"inputs":[{"name":"usize"},{"name":"classicalregister"}],"output":{"name":"quantumregister"}}],[11,"apply","","Apply a quantum gate to this register, mutating its state.",6,null],[11,"collapse","","Collapse the register to yield one a classical state.",6,null],[11,"eq","","",7,null],[11,"ne","","",7,null],[11,"fmt","","",7,null],[11,"new","","Construct a new non-quantum register, given a vector of ones and zeroes.",7,{"inputs":[{"name":"vec"}],"output":{"name":"classicalregister"}}],[11,"from_state","","Construct a new non-quantum register, given a `state`.",7,{"inputs":[{"name":"usize"},{"name":"u32"}],"output":{"name":"classicalregister"}}],[11,"from_int","","Construct a new non-quantum register, given an unsigned integer.",7,{"inputs":[{"name":"usize"},{"name":"u32"}],"output":{"name":"classicalregister"}}],[11,"zeroed","","Construct zero-initialized non-quantum register of given `width`.",7,{"inputs":[{"name":"usize"}],"output":{"name":"classicalregister"}}],[11,"width","","Compute the register's `width`.",7,null],[11,"state","","Compute the current `state` of the register.",7,null],[11,"to_int","","Return the integer represented by this register.",7,null],[14,"c!","quantum","Convenience macro for complex number construction.",null,null],[14,"square!","","Square a numeric value efficiently by multiplying it with itself.",null,null],[14,"abs_square!","","Compute a complex number's absolute value, i.e. _|x + iy|^2_.",null,null]],"paths":[[3,"Complex"],[3,"QuantumComputer"],[3,"Gate"],[3,"Ket"],[3,"Matrix"],[3,"NonEntangledQubit"],[3,"QuantumRegister"],[3,"ClassicalRegister"]]}; initSearch(searchIndex);