Copying local files to/from your QMI If you've developed a program on your local computer, you can move this file to your QMI for execution in the quantum environment by using SCP (secure copy protocol), or through a third-party client for FTP (file transfer protocol).
SCP files onto your QMI Open up a terminal and:
scp /path/to/directory forest@qmi:/home/forest
scp /path/to/file forest@qmi:/home/forest
SCP files onto your local computer Similarly, to copy a file from your QMI onto your local computer, you can use the SCP command in the opposite direction. Open up a terminal and run the following:
scp -i <path-to-private-key> forest@qmi: /home/forest/path-to-directories
scp -i <path-to-private-key> forest@qmi: /home/forest/path-to-files
Editing QMI files locally To easily edit a file that is stored on your QMI, we recommend the following third-party tools:
Sublime Text 1. Install the SFTP Package a. Open command palette: ctrl+shift+p (Win, Linux) or cmd+shift+p (Mac) b. Select "Package Control: Install package" (by typing install and pressing enter) c. Type SFTP and hit enter 2. Set up the server a. Go to File > SFTP > Setup Server b. "remote_path" : "/home/forest/" c. "host" : "<YOUR_QMI_IP_ADDRESS>" d. "user" : "forest" 3. Browse one file at a time a. File > SFTP > Browse Server 4. Work on a single folder locally, and upload all changes to your QMI upon saving any file in the folder— recommended a. In your QMI, use mkdir <folder_name> to create a new folder to sync your files to b. In Sublime Text, on your local machine, open the folder you would like to sync c. Right click on the folder name in the side bar (View > Side Bar > Hide Side Bar) d. Select SFTP/FTP > Map to Remote. This will open up a file called sftp-config.json in your folder. e. Set upload_on_save to true f. Change host and user as in section 2 above for setting up a server g. Set the remote path to the name of the directory you created in your QMI. This must be a full path, such as /home/forest/my_work/ h. Right click on the folder name again. Go to SFTP/FTP > Upload Folder to move all your local files to your QMI.
Emacs 1. Read about TRAMP (built-in), which allows your local Emacs to interface with one or more remote machines. You won't need to copy your configuration to QMI, nor be relegated to running Emacs in terminal mode. 2. Navigate to /ssh:forest@<YOUR_QMI_IP_ADDRESS>:/home/forest/hello_qmi.py to test your TRAMP configuration. Ensure the key you registered with the QMI is added to your ssh agent. 3. Notice that your usual modes and configuration are still active, even though you are editing a buffer for a remote file. When you save the buffer, TRAMP ensures the file is updated on the QMI. 4. Many Emacs tools like shells, bookmarks, file explorers, project management, Docker interfaces, and Git clients have automatic TRAMP support. These enable advanced navigation and manipulation of projects on the QMI, and obviate running terminal commands over SSH for most use-cases.
Pulling from Github repositories 1. Generate an ssh-key pair from your QMI, similar to the process used to authenticate your QMI connection. 2. Add the public key you just generated to your Github account. Now you should have permission to pull your private and public Github repositories.