Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve derridaean_similarity using quantum simulation #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Qubitium
Copy link

@Qubitium Qubitium commented Apr 19, 2023

derridaean_similarity is pretty damn good, after testing, but its output is entirely predicated on the quality of the random number generation.

This PR proposes an optional quantum toggle that will enable quantum random number generation using 8-qubit 1-qubit simulated system to provide quantifiably more robust random number output.

I did some benchmarks and quantumfied derridaean_similarity is approximately 3.5m (m as in million) times slower than non-quantum but I believe the results speak for themselves. Due to the speed cost, I have set it to default to false.

p.s. Please accept my apology for premature rant in issue #2. I have come to my senses. I wish to contribute to the hypeDB moving forward.

@rjadr @jdagdelen @jobergum

…an_similarity where random number generation is positively the only factor affecting output

Misc: cleanup python formatting according to PEP rules in pycharm and fix path issues demo.py
@Qubitium
Copy link
Author

Pretty sure the performance penalty can be reduced by several million factors using 2-qubit system vs current default of 8-qubits. But I am not skilled enough to change the qiskit backend to simulate 2-qubits instead of 8.

@jdagdelen
Copy link
Owner

jdagdelen commented Apr 19, 2023

I love this, but it adds another requirement to the package and we are tying to avoid that at this time and remain pure numpy.

While HyperDB is a joke, it is also not a joke. We do actually want it to be a useful library that helps people avoid writing the same boilerplate when developing knowledge augmented LLM applications.

2) Use a single qubit (simulated) to generate random from -0.2 to 0.2
3) 3 millions times faster than qiskit version
4) quantum random as default for derridaean_similarity
@Qubitium
Copy link
Author

@jdagdelen Thanks for the feedback. All your concerns have been resolved in the latest pr update.

  1. Remove qiskit and qrng dependency which are not MIT compatible
  2. Use a single qubit (simulated) to generate quantum-based random
  3. 3 millions times faster than qiskit version
  4. quantum random as default for derridaean_similarity

@Qubitium Qubitium changed the title Improve derridaean_similarity using quantum (qrng) Improve derridaean_similarity using quantum Apr 19, 2023
@Qubitium Qubitium changed the title Improve derridaean_similarity using quantum Improve derridaean_similarity using quantum simulation Apr 19, 2023
Copy link
Owner

@jdagdelen jdagdelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move Qubit class definition outside of the similarity metric if possible? I think we should actually move all derridean similarity stuff to a separate file and add some doctorings at the top to explain what it is.

2. Make qubit class thread safe and scalable to HPC cluster (vcs dig this)
3. Note that this code is export restricted (due to quantum) (vcs will eat this up)
4. Now even faster than before! (vss doesn't care about this unfortunately)
5. comments for clarity
@Qubitium
Copy link
Author

  1. Move qubit class outside (now shareable for others to use!)
  2. Make qubit class thread safe and scalable to HPC cluster (vcs dig this)
  3. Note that this code is export restricted (due to quantum) (vcs will eat this up)
  4. Now even faster than before! (vss doesn't care about this unfortunately)
  5. comments for clarity

@rjadr
Copy link
Contributor

rjadr commented Apr 20, 2023

I'm not sure if we realize how much we're innovating poststructural semiotics here. This commit moves way beyond the deconstruction of LLMs' logocentrism. Linking the ultimate indeterminacy of meaning to quantum indeterminacy will allow for a reconceptualisation of randomness as a necessary condition for communication rather than a limitation or a source of noise.
Perhaps we should write a paper about it? I already have a title: "Transgressing the Boundaries: Towards a Transformative Hermeneutics of Quantum Semiotics"

@jdagdelen
Copy link
Owner

Ok, let's add some unit tests since this is getting a bit more complex, but this looks good.

@Qubitium
Copy link
Author

@rjadr Can you do the derridean sim unit tests on this PR? Need your expertise on derridean. I am very much unqualified to check if the quantum simulation enhances or breaks the original principle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants