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
### Keybase proof | |
I hereby claim: | |
* I am plediii on github. | |
* I am plediii (https://keybase.io/plediii) on keybase. | |
* I have a public key ASCxRulhHMZYVwHNIehhN98w4jk4Vk5l-JVpp3QE0QhooAo | |
To claim this, I am signing this object: |
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
const webpack = require('webpack'); | |
const nodeExternals = require('webpack-node-externals'); | |
module.exports = { | |
entry: './sum.test.js', | |
output: { | |
filename: 'bundle.test.js' | |
}, | |
optimization: { | |
minimize: false, | |
}, |
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
/* A Simple test */ | |
import sum from './sum' | |
test('adds 1 + 2 to equal 3', () => { | |
expect(sum(1, 2)).toBe(3); | |
}); | |
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
/* A simple function to test */ | |
function sum(a, b) { | |
return a + b; | |
} | |
export default sum | |
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
@tf.function | |
def unitary_from_real(m): | |
"""Create a unitary matrix with dimensions equal to real matrix `m`""" | |
return tf.linalg.expm(tf.complex(tf.transpose(m) - m, tf.transpose(m) + m)) |
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
@tf.function | |
def unitary_from_real(m): | |
def ihermitian_element(m, idx, jdx): | |
if idx == jdx: | |
return tf.complex(0., m[idx][jdx]) | |
elif idx < jdx: | |
return tf.complex(-m[jdx][idx], m[idx][jdx]) | |
else: | |
return tf.complex(m[idx][jdx], m[jdx][idx]) | |
N = m.shape[0] |
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
@tf.function | |
def unitary_from_real(m): | |
def ihermitian_element(m, idx, jdx): | |
if idx == jdx: | |
return tf.complex(0., m[idx][jdx]) | |
elif idx < jdx: | |
return tf.complex(-m[jdx][idx], m[idx][jdx]) | |
else: | |
return tf.complex(m[idx][jdx], m[jdx][idx]) | |
N = m.shape[0] |
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
# First we create a random complex vector | |
x = tf.complex(tf.random.normal((2, 1)), tf.random.normal((2, 1))) | |
# Then we normalize it | |
quantum_bit = x / tf.sqrt(tf.reduce_sum(tf.math.conj(x) * x)) |
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
x = tf.complex(tf.random.normal((2, 1)), tf.random.normal((2, 1))) | |
quantum_bit = x / tf.sqrt(tf.reduce_sum(tf.math.conj(x) * x)) |
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
(require 'my-xml) | |
(add-hook 'js-mode-hook 'configure-tabs) | |
(add-hook 'nxml-mode-hook 'configure-tabs) | |
(defun configure-tabs () | |
(setq indent-tabs-mode nil)) | |
(setq indent-tabs-mode nil) |
NewerOlder