From a481bfa231ce1dc4eeaec2a1c1db740e267f663e Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 18 Oct 2020 18:07:27 +0200 Subject: [PATCH] Fix broken build: Remove trailing spaces (#3501) * Fix broken build: Remove trailing spaces * updating DIRECTORY.md * One more trailing space Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> --- DIRECTORY.md | 3 +++ quantum/deutsch_jozsa.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 72133a6..0f4aeef 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -48,6 +48,7 @@ * [Base32](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base32.py) * [Base64 Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base64_cipher.py) * [Base85](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base85.py) + * [Beaufort Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/beaufort_cipher.py) * [Brute Force Caesar Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/brute_force_caesar_cipher.py) * [Caesar Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/caesar_cipher.py) * [Cryptomath Module](https://github.com/TheAlgorithms/Python/blob/master/ciphers/cryptomath_module.py) @@ -58,6 +59,7 @@ * [Enigma Machine2](https://github.com/TheAlgorithms/Python/blob/master/ciphers/enigma_machine2.py) * [Hill Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/hill_cipher.py) * [Mixed Keyword Cypher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/mixed_keyword_cypher.py) + * [Mono Alphabetic Ciphers](https://github.com/TheAlgorithms/Python/blob/master/ciphers/mono_alphabetic_ciphers.py) * [Morse Code Implementation](https://github.com/TheAlgorithms/Python/blob/master/ciphers/morse_code_implementation.py) * [Onepad Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/onepad_cipher.py) * [Playfair Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/playfair_cipher.py) @@ -710,6 +712,7 @@ * [Validate Solutions](https://github.com/TheAlgorithms/Python/blob/master/project_euler/validate_solutions.py) ## Quantum + * [Deutsch Jozsa](https://github.com/TheAlgorithms/Python/blob/master/quantum/deutsch_jozsa.py) * [Half Adder](https://github.com/TheAlgorithms/Python/blob/master/quantum/half_adder.py) * [Not Gate](https://github.com/TheAlgorithms/Python/blob/master/quantum/not_gate.py) * [Quantum Entanglement](https://github.com/TheAlgorithms/Python/blob/master/quantum/quantum_entanglement.py) diff --git a/quantum/deutsch_jozsa.py b/quantum/deutsch_jozsa.py index da1b6e4..304eea1 100755 --- a/quantum/deutsch_jozsa.py +++ b/quantum/deutsch_jozsa.py @@ -5,14 +5,14 @@ algorithm that is exponentially faster than any possible deterministic classical algorithm Premise: -We are given a hidden Boolean function f, +We are given a hidden Boolean function f, which takes as input a string of bits, and returns either 0 or 1: f({x0,x1,x2,...}) -> 0 or 1, where xn is 0 or 1 - + The property of the given Boolean function is that it is guaranteed to -either be balanced or constant. A constant function returns all 0's -or all 1's for any input, while a balanced function returns 0's for +either be balanced or constant. A constant function returns all 0's +or all 1's for any input, while a balanced function returns 0's for exactly half of all inputs and 1's for the other half. Our task is to determine whether the given function is balanced or constant. -- GitLab