-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Katsujukou Kineya <[email protected]>
- Loading branch information
1 parent
8d38738
commit 4da82bb
Showing
81 changed files
with
4,705 additions
and
8,725 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,34 @@ | ||
drop table if exists main.devices; | ||
CREATE TABLE IF NOT EXISTS main.devices ( | ||
id VARCHAR(64) PRIMARY KEY, | ||
device_type ENUM ('QPU', 'simulator') NOT NULL, | ||
status ENUM ('AVAILABLE', 'NOT_AVAILABLE') DEFAULT 'NOT_AVAILABLE' NOT NULL, | ||
restart_at DATETIME, | ||
pending_tasks INT DEFAULT 0 NOT NULL, | ||
n_qubits INT NOT NULL, | ||
n_nodes INT, | ||
device_type VARCHAR(32) DEFAULT 'QPU' NOT NULL, | ||
status VARCHAR(64) DEFAULT 'available' NOT NULL, | ||
available_at DATETIME, | ||
pending_jobs INT DEFAULT 0 NOT NULL, | ||
n_qubits INT DEFAULT 1 NOT NULL, | ||
basis_gates VARCHAR(256) NOT NULL, | ||
instructions VARCHAR(64) NOT NULL, | ||
calibration_data TEXT, | ||
device_info TEXT, | ||
calibrated_at DATETIME, | ||
description VARCHAR(128) NOT NULL | ||
description VARCHAR(128) NOT NULL, | ||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); | ||
|
||
-- INSERT INTO main.devices (id, device_type, n_qubits, n_nodes, basis_gates, instructions, description) | ||
-- SELECT 'SC', 'QPU', 64, NULL, '["sx", "rz", "rzx90", "id"]', '["measure", "barrier"]', 'Superconducting quantum computer' | ||
-- WHERE NOT EXISTS (SELECT * FROM main.devices WHERE id = 'SC'); | ||
|
||
-- INSERT INTO main.devices (id, device_type, n_qubits, n_nodes, basis_gates, instructions, description) | ||
-- SELECT 'SVSim', 'simulator', 39, 512, '["x", "y", "z", "h", "s", "sdg", "t", "tdg", "rx", "ry", "rz", "cx", "cz", "swap", "u1", "u2", "u3", "u", "p", "id", "sx", "sxdg"]', '["measure", "barrier", "reset"]', 'State vector-based quantum circuit simulator' | ||
-- WHERE NOT EXISTS (SELECT * FROM main.devices WHERE id = 'SVSim'); | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS main.tasks ( | ||
id VARBINARY(16) PRIMARY KEY, | ||
drop table if exists main.jobs; | ||
CREATE TABLE IF NOT EXISTS main.jobs ( | ||
id VARCHAR(64) PRIMARY KEY, | ||
owner VARCHAR(64) NOT NULL, | ||
name varchar(256), | ||
device VARCHAR(64) NOT NULL, | ||
n_qubits INT, | ||
n_nodes INT, | ||
code TEXT NOT NULL, | ||
action ENUM ('sampling', 'estimation') NOT NULL, | ||
method ENUM ('state_vector', 'sampling'), | ||
shots INT, | ||
operator VARCHAR(1024), | ||
qubit_allocation TEXT, | ||
skip_transpilation BOOLEAN DEFAULT false NOT NULL, | ||
seed_transpilation INT, | ||
seed_simulation INT, | ||
n_per_node INT UNSIGNED, | ||
simulation_opt text, | ||
ro_error_mitigation enum('none', 'pseudo_inverse', 'least_square'), | ||
note VARCHAR(1024), | ||
status ENUM ('QUEUED', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLING', 'CANCELLED') NOT NULL DEFAULT 'QUEUED', | ||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | ||
FOREIGN KEY (device) REFERENCES devices(id) | ||
name varchar(256) DEFAULT '' NOT NULL, | ||
description VARCHAR(1024), | ||
device_id VARCHAR(64) NOT NULL, | ||
job_info TEXT, | ||
transpiler_info TEXT, | ||
simulator_info TEXT, | ||
mitigation_info TEXT, | ||
job_type VARCHAR(32) DEFAULT 'sampling' NOT NULL, | ||
shots INT DEFAULT 1000 NOT NULL, | ||
status VARCHAR(32) DEFAULT 'submitted' NOT NULL, | ||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS main.results ( | ||
task_id VARBINARY(16) PRIMARY KEY, | ||
status ENUM('SUCCESS', 'FAILURE', 'CANCELLED') NOT NULL, | ||
result TEXT, | ||
reason TEXT, | ||
transpiled_code TEXT, | ||
qubit_allocation TEXT, | ||
FOREIGN KEY (task_id) REFERENCES tasks(id) ON DELETE CASCADE | ||
); | ||
|
||
delimiter $$ | ||
|
||
CREATE TRIGGER main.update_tasks_status_trigger | ||
AFTER INSERT ON main.results | ||
FOR EACH ROW | ||
BEGIN | ||
IF NEW.status = 'SUCCESS' THEN | ||
UPDATE main.tasks SET status = 'COMPLETED' WHERE id = NEW.task_id; | ||
ELSEIF NEW.status = 'FAILURE' THEN | ||
UPDATE main.tasks SET status = 'FAILED' WHERE id = NEW.task_id; | ||
ELSEIF NEW.status = 'CANCELLED' THEN | ||
UPDATE main.tasks SET status = 'CANCELLED' WHERE id = NEW.task_id; | ||
END IF; | ||
END$$ | ||
|
||
delimiter ; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
INSERT INTO main.devices (id, device_type,status, n_qubits, n_nodes, basis_gates, instructions, description) | ||
SELECT 'SC', 'QPU','AVAILABLE', 64, NULL, '["sx", "rz", "rzx90", "id"]', '["measure", "barrier"]', 'Superconducting quantum computer' | ||
INSERT INTO main.devices (id, device_type, status, available_at, pending_jobs, n_qubits, basis_gates, instructions, device_info, calibrated_at, description) | ||
SELECT 'SC', 'QPU','available', CURRENT_TIMESTAMP, 9, 64, '["sx", "rz", "rzx90", "id"]', '["measure", "barrier"]', '', CURRENT_TIMESTAMP, 'Superconducting quantum computer' | ||
WHERE NOT EXISTS (SELECT * FROM main.devices WHERE id = 'SC'); | ||
|
||
INSERT INTO main.devices (id, device_type, status, n_qubits, n_nodes, basis_gates, instructions, description) | ||
SELECT 'SVSim', 'simulator','AVAILABLE', 39, 512, '["x", "y", "z", "h", "s", "sdg", "t", "tdg", "rx", "ry", "rz", "cx", "cz", "swap", "u1", "u2", "u3", "u", "p", "id", "sx", "sxdg"]', '["measure", "barrier", "reset"]', 'State vector-based quantum circuit simulator' | ||
INSERT INTO main.devices (id, device_type, status, available_at, pending_jobs, n_qubits, basis_gates, instructions, device_info, calibrated_at, description) | ||
SELECT 'SVSim', 'simulator','available', CURRENT_TIMESTAMP, 0, 39, '["x", "y", "z", "h", "s", "sdg", "t", "tdg", "rx", "ry", "rz", "cx", "cz", "swap", "u1", "u2", "u3", "u", "p", "id", "sx", "sxdg"]', '["measure", "barrier", "reset"]', '', CURRENT_TIMESTAMP, 'State vector-based quantum circuit simulator' | ||
WHERE NOT EXISTS (SELECT * FROM main.devices WHERE id = 'SVSim'); | ||
|
||
INSERT INTO main.devices (id, device_type, status, n_qubits, n_nodes, basis_gates, instructions, description) | ||
SELECT 'Kawasaki', 'QPU','AVAILABLE', 64, NULL, '["sx", "rz", "rzx90", "id"]', '["measure", "barrier"]', 'Superconducting quantum computer' | ||
INSERT INTO main.devices (id, device_type, status, available_at, pending_jobs, n_qubits, basis_gates, instructions, device_info, calibrated_at, description) | ||
SELECT 'Kawasaki', 'QPU','available', CURRENT_TIMESTAMP, 2, 64, '["sx", "rz", "rzx90", "id"]', '["measure", "barrier"]', '', CURRENT_TIMESTAMP, 'Superconducting quantum computer' | ||
WHERE NOT EXISTS (SELECT * FROM main.devices WHERE id = 'Kawasaki'); | ||
|
||
INSERT INTO main.devices (id, device_type, n_qubits, n_nodes, basis_gates, instructions, description) | ||
SELECT 'test1', 'QPU', 64, NULL, '["sx", "rz", "rzx90", "id"]', '["measure", "barrier"]', 'Superconducting quantum computer' | ||
WHERE NOT EXISTS (SELECT * FROM main.devices WHERE id = 'test'); | ||
INSERT INTO main.devices (id, device_type, status, available_at, pending_jobs, n_qubits, basis_gates, instructions, device_info, calibrated_at, description) | ||
SELECT '01927422-86d4-7597-b724-b08a5e7781fc', 'QPU','unavailable', CURRENT_TIMESTAMP, 0, 64, '["sx", "rz", "rzx90", "id"]', '["measure", "barrier"]', '', CURRENT_TIMESTAMP, 'Superconducting quantum computer' | ||
WHERE NOT EXISTS (SELECT * FROM main.devices WHERE id = '01927422-86d4-7597-b724-b08a5e7781fc'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
INSERT INTO main.jobs (id, owner, name, description, device_id, job_info, transpiler_info, simulator_info, mitigation_info, job_type, shots, status) | ||
SELECT '01927422-86d4-73d6-abb4-f2de6a4f5910', 'admin', 'Test job 1', 'Test job 1 description', 'Kawasaki', '{\'code\': \'todo\'}', '', '', '', 'sampling', 1000, 'submitted' | ||
WHERE NOT EXISTS (SELECT * FROM main.jobs WHERE owner = 'admin' AND name = 'Test job 1'); | ||
|
||
INSERT INTO main.jobs (id, owner, name, description, device_id, job_info, transpiler_info, simulator_info, mitigation_info, job_type, shots, status) | ||
SELECT '01927422-86d4-7cbf-98d3-32f5f1263cd9', 'admin', 'Test job 2', 'Test job 2 description', 'Kawasaki', '{\'code\': \'todo\'}', '', '', '', 'sampling', 1000, 'submitted' | ||
WHERE NOT EXISTS (SELECT * FROM main.jobs WHERE owner = 'admin' AND name = 'Test job 2'); | ||
|
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.