This file contains hidden or 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
| [deps] | |
| CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" | |
| Yao = "5872b779-8223-5990-8dd0-5abbb0748c8c" | |
| Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" | |
| [compat] | |
| CUDA = "5" | |
| Yao = "0.9.3" | |
| Zygote = "0.7" | |
| julia = "1.11" |
This file contains hidden or 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
| #!/bin/bash | |
| # the script is fully created by Google Gemini | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 [file_extension]" | |
| echo " [file_extension] - Optional file extension to filter by (default: .py)" | |
| exit 1 | |
| } | |
| # Default file extension |
This file contains hidden or 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
| import tensorflow as tf | |
| import tensorflow_quantum as tfq | |
| import cirq | |
| import sympy | |
| import numpy as np | |
| nwires, nlayers = 6, 3 | |
| qubits = [cirq.GridQubit(0, i) for i in range(nwires)] | |
| symbols = sympy.symbols("params_0:" + str(nlayers * nwires * 2)) |
This file contains hidden or 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
| import tensorflow as tf | |
| ## note tape.watch() cannot accept ragged tensor as input | |
| rt = tf.ragged.constant([[1.], [2., 3.]]) | |
| # rt = rt.to_tensor() | |
| with tf.GradientTape() as t: | |
| t.watch(rt.values) | |
| loss = 2*rt[0,0]+rt[1,1]**3 | |
| g_flatten = t.gradient(loss, rt.values) | |
| g = rt.with_values(g_flatten) | |
| print(g) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| import xalpha as xa | |
| import pandas as pd | |
| import datetime as dt | |
| def _percent(r): | |
| return round((r-1)*100, 2) | |
| def index_analysis(code, start, end): | |
| dfe = xa.get_daily("peb-"+code, end=end, prev=20).iloc[-1] | |
| end = dfe["date"].strftime("%Y%m%d") |
This file contains hidden or 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.custom_gradient | |
| def idn(x): | |
| def grad(*dx): | |
| return tf.zeros_like(dx[0]) | |
| return x, grad | |
| def probexp(beta, s): | |
| return tf.exp(-beta*s) | |
| def obss(beta, s): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| #! /bin/bash | |
| ips=("8.8.8.8" | |
| "baidu.com") | |
| webs=("http://10.0.0.1:8080") | |
| address="user@mails.domain" | |
| for ip in "${ips[@]}"; do |
NewerOlder