Created
June 28, 2023 19:37
-
-
Save graylan0/7bd1eed13a4bfe5256055411ce38a00f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reate_particle(quanta) | |
# Print the total orientation of the particle | |
print(particle.total_orientation()) | |
# Visualize the particle | |
particle.visualize() | |
# Change the orientation of the particle | |
particle.change_orientation(5) | |
# Print the total orientation of the particle after the change | |
print(particle.total_orientation()) | |
# Visualize the particle after the change | |
particle.visualize() | |
## Create a complex particle from multiple particles | |
complex_particle = create_complex_particle([particle, particle]) | |
# Print the total orientation of the complex particle | |
print(complex_particle.total_orientation()) | |
# Visualize the complex particle | |
complex_particle.visualize() | |
# Simulate an interaction between two particles | |
result = interact(particle, complex_particle) | |
# The `result` would be a new particle or complex particle resulting from the interaction | |
# Entangle two particles | |
particle1 = create_particle(quanta[:5]) | |
particle2 = create_particle(quanta[5:]) | |
particle1.entangle(particle2) | |
# The states of particle1 and particle2 are now linked due to entanglement | |
# Test Paradigm 1: Test the distance_to function | |
particle1 = create_particle(quanta[:5]) | |
particle2 = create_particle(quanta[5:]) | |
print(particle1.distance_to(particle2)) | |
# Test Paradigm 2: Test the simulate_interactions function | |
particle1, particle2 = simulate_interactions(particle1, particle2, 10) | |
print(particle1.total_orientation()) | |
print(particle2.total_orientation()) | |
# Test Paradigm 3: Test the entangle function | |
particle1.entangle(particle2) | |
print(particle1.total_orientation()) # Should be the same as particle2's total orientation | |
print(particle2.total_orientation()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment