-
Notifications
You must be signed in to change notification settings - Fork 2
/
005_qonfusion_gaussian_2dimage.py
53 lines (49 loc) · 1.43 KB
/
005_qonfusion_gaussian_2dimage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import hydra
import numpy as np
import pennylane as qml
from omegaconf import DictConfig, OmegaConf
from hydra.core.hydra_config import HydraConfig
from hydra import compose, initialize
from pennylane import numpy as np
import pennylane as qml
import pennylane.numpy as np
from datetime import datetime
import math
import cv2
from PIL import Image
import os
import glob
from PIL import Image
import io
import matplotlib.animation as animation
import pennylane as qml
import pennylane.numpy as np
import torch
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# from qutip import Bloch
from torch import Tensor
from q.model import *
def get_conf():
initialize(version_base=None,config_path='conf', job_name="q2dimage_config.yaml")
cfg = compose(config_name="q2dimage_config")
return cfg
if __name__ == '__main__':
cfg=get_conf()
print(OmegaConf.to_yaml(cfg))
img_w = int(cfg.model.img_w)
rgb_c = int(cfg.model.rgb_c)
n_samples = int(cfg.model.samples)
singlExp_val_global = int(cfg.model.singlExp_val_global)
sample_shots = int(cfg.model.sample_shots)
paper_dir=(cfg.paper.dir)
os.makedirs(paper_dir, exist_ok=True)
for qub in [5]:
for t in [False]:
q = QuantumRandomGaussianCurruptor(cfg, qub, plotCircuit=False, useRot=t)
q.run(1)